]> git.kaiwu.me - njs.git/commitdiff
Parser: unused strict_semicolon cleanup.
authorDmitry Volyntsev <xeioex@nginx.com>
Sat, 14 Jun 2025 03:19:36 +0000 (20:19 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 17 Jun 2025 00:36:31 +0000 (17:36 -0700)
src/njs_parser.c
src/njs_parser.h

index de11b8c93077a2d210596b355216500a49079129..cfaad7409d05a6d39a932696aa2b78905c3cd500 100644 (file)
@@ -839,10 +839,9 @@ njs_inline njs_int_t
 njs_parser_expect_semicolon(njs_parser_t *parser, njs_lexer_token_t *token)
 {
     if (token->type != NJS_TOKEN_SEMICOLON) {
-        if (parser->strict_semicolon
-            || (token->type != NJS_TOKEN_END
-                && token->type != NJS_TOKEN_CLOSE_BRACE
-                && parser->lexer->prev_type != NJS_TOKEN_LINE_END))
+        if (token->type != NJS_TOKEN_END
+            && token->type != NJS_TOKEN_CLOSE_BRACE
+            && parser->lexer->prev_type != NJS_TOKEN_LINE_END)
         {
             return NJS_DECLINED;
         }
@@ -5408,10 +5407,6 @@ static njs_int_t
 njs_parser_do_while_semicolon(njs_parser_t *parser, njs_lexer_token_t *token,
     njs_queue_link_t *current)
 {
-    if (parser->strict_semicolon) {
-        return njs_parser_failed(parser);
-    }
-
     parser->target->right = parser->node;
     parser->node = parser->target;
 
@@ -6257,10 +6252,9 @@ njs_parser_break_continue(njs_parser_t *parser, njs_lexer_token_t *token,
             break;
         }
 
-        if (parser->strict_semicolon
-            || (token->type != NJS_TOKEN_END
-                && token->type != NJS_TOKEN_CLOSE_BRACE
-                && parser->lexer->prev_type != NJS_TOKEN_LINE_END))
+        if (token->type != NJS_TOKEN_END
+            && token->type != NJS_TOKEN_CLOSE_BRACE
+            && parser->lexer->prev_type != NJS_TOKEN_LINE_END)
         {
             return njs_parser_failed(parser);
         }
@@ -6314,9 +6308,7 @@ njs_parser_return_statement(njs_parser_t *parser, njs_lexer_token_t *token,
         return njs_parser_failed(parser);
 
     default:
-        if (!parser->strict_semicolon
-            && parser->lexer->prev_type == NJS_TOKEN_LINE_END)
-        {
+        if (parser->lexer->prev_type == NJS_TOKEN_LINE_END) {
             break;
         }
 
index ebe5e686e0df914d47660d7358dd7e25fff5d098..8a67bdab80099e7cbd6dc42bade17c7225e616f8 100644 (file)
@@ -84,7 +84,6 @@ struct njs_parser_s {
     uint8_t                         use_lhs;
 
     uint8_t                         module;
-    njs_bool_t                      strict_semicolon;
 
     njs_str_t                       file;
     uint32_t                        line;