Skip to content

Commit b61e1d2

Browse files
committed
Parser: unused strict_semicolon cleanup.
1 parent dbaab11 commit b61e1d2

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

src/njs_parser.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,9 @@ njs_inline njs_int_t
839839
njs_parser_expect_semicolon(njs_parser_t *parser, njs_lexer_token_t *token)
840840
{
841841
if (token->type != NJS_TOKEN_SEMICOLON) {
842-
if (parser->strict_semicolon
843-
|| (token->type != NJS_TOKEN_END
844-
&& token->type != NJS_TOKEN_CLOSE_BRACE
845-
&& parser->lexer->prev_type != NJS_TOKEN_LINE_END))
842+
if (token->type != NJS_TOKEN_END
843+
&& token->type != NJS_TOKEN_CLOSE_BRACE
844+
&& parser->lexer->prev_type != NJS_TOKEN_LINE_END)
846845
{
847846
return NJS_DECLINED;
848847
}
@@ -5408,10 +5407,6 @@ static njs_int_t
54085407
njs_parser_do_while_semicolon(njs_parser_t *parser, njs_lexer_token_t *token,
54095408
njs_queue_link_t *current)
54105409
{
5411-
if (parser->strict_semicolon) {
5412-
return njs_parser_failed(parser);
5413-
}
5414-
54155410
parser->target->right = parser->node;
54165411
parser->node = parser->target;
54175412

@@ -6257,10 +6252,9 @@ njs_parser_break_continue(njs_parser_t *parser, njs_lexer_token_t *token,
62576252
break;
62586253
}
62596254

6260-
if (parser->strict_semicolon
6261-
|| (token->type != NJS_TOKEN_END
6262-
&& token->type != NJS_TOKEN_CLOSE_BRACE
6263-
&& parser->lexer->prev_type != NJS_TOKEN_LINE_END))
6255+
if (token->type != NJS_TOKEN_END
6256+
&& token->type != NJS_TOKEN_CLOSE_BRACE
6257+
&& parser->lexer->prev_type != NJS_TOKEN_LINE_END)
62646258
{
62656259
return njs_parser_failed(parser);
62666260
}
@@ -6314,9 +6308,7 @@ njs_parser_return_statement(njs_parser_t *parser, njs_lexer_token_t *token,
63146308
return njs_parser_failed(parser);
63156309

63166310
default:
6317-
if (!parser->strict_semicolon
6318-
&& parser->lexer->prev_type == NJS_TOKEN_LINE_END)
6319-
{
6311+
if (parser->lexer->prev_type == NJS_TOKEN_LINE_END) {
63206312
break;
63216313
}
63226314

src/njs_parser.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ struct njs_parser_s {
8484
uint8_t use_lhs;
8585

8686
uint8_t module;
87-
njs_bool_t strict_semicolon;
8887

8988
njs_str_t file;
9089
uint32_t line;

0 commit comments

Comments
 (0)