Mercurial > njs
changeset 2576:6018de6f6c59
Parser: unused strict_semicolon cleanup.
| author | Dmitry Volyntsev <xeioex@nginx.com> |
|---|---|
| date | Fri, 13 Jun 2025 20:19:36 -0700 |
| parents | 9be6834ec6ff |
| children | 09355ab5e63a |
| files | src/njs_parser.c src/njs_parser.h |
| diffstat | 2 files changed, 7 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/njs_parser.c Thu Jun 12 17:33:35 2025 -0700 +++ b/src/njs_parser.c Fri Jun 13 20:19:36 2025 -0700 @@ -839,10 +839,9 @@ 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 @@ 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 @@ 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 @@ 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; }
