diff options
author | Dmitry Volyntsev <xeioex@nginx.com> | 2025-06-13 20:19:36 -0700 |
---|---|---|
committer | Dmitry Volyntsev <xeioexception@gmail.com> | 2025-06-16 17:36:31 -0700 |
commit | 5431ea1f16d7587eddccda1b4e6579325070e76b (patch) | |
tree | d9fedda2108e235eeb04c55da662f314df0e8d31 /src | |
parent | 030712507797c42db146c7ee0399a882f47e6ebe (diff) | |
download | njs-5431ea1f16d7587eddccda1b4e6579325070e76b.tar.gz njs-5431ea1f16d7587eddccda1b4e6579325070e76b.zip |
Parser: unused strict_semicolon cleanup.
Diffstat (limited to 'src')
-rw-r--r-- | src/njs_parser.c | 22 | ||||
-rw-r--r-- | src/njs_parser.h | 1 |
2 files changed, 7 insertions, 16 deletions
diff --git a/src/njs_parser.c b/src/njs_parser.c index de11b8c9..cfaad740 100644 --- a/src/njs_parser.c +++ b/src/njs_parser.c @@ -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; } diff --git a/src/njs_parser.h b/src/njs_parser.h index ebe5e686..8a67bdab 100644 --- a/src/njs_parser.h +++ b/src/njs_parser.h @@ -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; |