From: Alexander Borisov Date: Thu, 25 Jun 2020 10:10:04 +0000 (+0300) Subject: Parser: fixed broken for expressions parsing. X-Git-Tag: 0.4.2~18 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=32a70c899c1f136fbc3f97fcc050d59e0bd8c6a5;p=njs.git Parser: fixed broken for expressions parsing. --- diff --git a/src/njs_parser.c b/src/njs_parser.c index 39f43db2..d022fcf1 100644 --- a/src/njs_parser.c +++ b/src/njs_parser.c @@ -5218,7 +5218,7 @@ njs_parser_iteration_statement_for_map(njs_parser_t *parser, njs_parser_next(parser, njs_parser_expression); - return njs_parser_after(parser, current, NULL, 0, + return njs_parser_after(parser, current, NULL, 1, njs_parser_for_expression); } diff --git a/src/test/njs_unit_test.c b/src/test/njs_unit_test.c index b5812579..283e6a62 100644 --- a/src/test/njs_unit_test.c +++ b/src/test/njs_unit_test.c @@ -17040,6 +17040,9 @@ static njs_unit_test_t njs_test[] = { njs_str("`${{f(){-} - {}}`"), njs_str("SyntaxError: Unexpected token \"}\" in 1") }, + + { njs_str("for (;1-;) {}"), + njs_str("SyntaxError: Unexpected token \";\" in 1") }, };