Files
zig/parser.c
Motiejus Jakštys befbe18ebc parser: fix while-type-expr continue parsing and comptime labeled blocks
Fix two parser bugs found by auditing against upstream Parse.zig:

1. In parseTypeExpr's while case, the continue expression was parsed
   inline as `eatToken(COLON) ? expectExpr : 0` which missed the
   required parentheses. Use parseWhileContinueExpr(p) instead,
   matching what parseWhileExpr already does.

2. In expectStatement, comptime blocks used parseBlock() which only
   matches `{ ... }`. Use parseBlockExpr() to also recognize labeled
   blocks like `comptime label: { ... }`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:22:53 +00:00

115 KiB