aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-06-29 10:13:15 +0100
committergingerBill <bill@gingerbill.org>2024-06-29 10:13:15 +0100
commit906afa41544c692f65467f1dba546a6ca4e71f1d (patch)
tree41f1e903a636c4e9a839e88e50fa513c4c2962a1 /src
parent06652bebce111640930a513c825e59f7b37bbd4f (diff)
Allow for `when x in y {` (minor oversight in syntax)
Diffstat (limited to 'src')
-rw-r--r--src/parser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 0e971f792..b1a179573 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -4573,9 +4573,12 @@ gb_internal Ast *parse_when_stmt(AstFile *f) {
isize prev_level = f->expr_level;
f->expr_level = -1;
+ bool prev_allow_in_expr = f->allow_in_expr;
+ f->allow_in_expr = true;
cond = parse_expr(f, false);
+ f->allow_in_expr = prev_allow_in_expr;
f->expr_level = prev_level;
if (cond == nullptr) {