From 225a2807f10ac02844eb2a7a65fdf7999a62ba66 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 12 Nov 2020 18:56:45 +0100 Subject: ast: simplify declaration AST structure Do not emit dummy T_ASSIGN nodes for plain variable declarations without initialization (`let foo` or `local foo`). This also allows simplifying `ut_check_for_in()` since we only need to deal with one common structure for both `for (... in ...)` and `for (local ... in ...)` cases. Signed-off-by: Jo-Philipp Wich --- tests/00_syntax/16_for_loop | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/00_syntax/16_for_loop') diff --git a/tests/00_syntax/16_for_loop b/tests/00_syntax/16_for_loop index 2f8ca9f..a16e0cc 100644 --- a/tests/00_syntax/16_for_loop +++ b/tests/00_syntax/16_for_loop @@ -238,8 +238,7 @@ In line 2, byte 16: Ensure that assignments in for-in loop expressions are rejected. -- Expect stderr -- -Syntax error: Unexpected token -Expecting ',' +Syntax error: Invalid for-in expression In line 2, byte 15: ` for (local x = 1, y in {})` -- cgit v1.2.3