summaryrefslogtreecommitdiffhomepage
path: root/ast.h
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-09-13 21:38:25 +0200
committerJo-Philipp Wich <jo@mein.io>2020-09-13 21:38:25 +0200
commitf2c5937fdfe0331790fc4c7a64c9df0b8d56c705 (patch)
treea19bc2ff1469b4c0e11849d73dd9c8fdd621721e /ast.h
parentdd67e7b992ded6b02a1c476f79fd9dc948d45730 (diff)
syntax: fix for() loop quirks and variable scoping
- Support `for (var x in ...)` syntax - Support `for (var i = 0; i < ...; i++)` syntax - Properly handle "for" loops without condition and increment expression - Reject for-in loops with invalid lhs Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'ast.h')
-rw-r--r--ast.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ast.h b/ast.h
index f65a91f..3466beb 100644
--- a/ast.h
+++ b/ast.h
@@ -56,6 +56,7 @@ struct ut_op {
uint16_t is_op:1;
uint16_t is_overflow:1;
uint16_t is_postfix:1;
+ uint16_t is_for_in:1;
uint32_t off;
struct json_object *val;
union {