mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
parse.zig: make parseForTypeExpr accept only a TypeExpr as body
This commit is contained in:
parent
3692fb039d
commit
483933d88d
@ -2616,7 +2616,7 @@ const Parser = struct {
|
||||
const found_payload = try p.parsePtrIndexPayload();
|
||||
if (found_payload == 0) try p.warn(.expected_loop_payload);
|
||||
|
||||
const then_expr = try p.expectExpr();
|
||||
const then_expr = try p.expectTypeExpr();
|
||||
const else_token = p.eatToken(.keyword_else) orelse {
|
||||
return p.addNode(.{
|
||||
.tag = .for_simple,
|
||||
|
||||
@ -5154,7 +5154,7 @@ test "recovery: missing for payload" {
|
||||
try testError(
|
||||
\\comptime {
|
||||
\\ const a = for(a) {};
|
||||
\\ const a: for(a) {};
|
||||
\\ const a: for(a) blk: {};
|
||||
\\ for(a) {}
|
||||
\\}
|
||||
, &[_]Error{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user