Skip to content

Commit a74119a

Browse files
xdBronchmlugg
authored andcommitted
bail when failing to parse error
1 parent dd75e7b commit a74119a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/std/zig/Parse.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,9 +2774,9 @@ fn parsePrimaryTypeExpr(p: *Parse) !?Node.Index {
27742774
else => {
27752775
const main_token = p.nextToken();
27762776
const period = p.eatToken(.period);
2777-
if (period == null) try p.warnExpected(.period);
2777+
if (period == null) return p.failExpected(.period);
27782778
const identifier = p.eatToken(.identifier);
2779-
if (identifier == null) try p.warnExpected(.identifier);
2779+
if (identifier == null) return p.failExpected(.identifier);
27802780
return try p.addNode(.{
27812781
.tag = .error_value,
27822782
.main_token = main_token,

lib/std/zig/parser_test.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6280,7 +6280,6 @@ test "recovery: invalid global error set access" {
62806280
\\}
62816281
, &[_]Error{
62826282
.expected_token,
6283-
.expected_token,
62846283
});
62856284
}
62866285

0 commit comments

Comments
 (0)