bail when failing to parse error

This commit is contained in:
xdBronch 2025-06-12 13:43:35 -04:00 committed by Matthew Lugg
parent dd75e7bcb1
commit a74119ac49
2 changed files with 2 additions and 3 deletions

View File

@ -2774,9 +2774,9 @@ fn parsePrimaryTypeExpr(p: *Parse) !?Node.Index {
else => { else => {
const main_token = p.nextToken(); const main_token = p.nextToken();
const period = p.eatToken(.period); const period = p.eatToken(.period);
if (period == null) try p.warnExpected(.period); if (period == null) return p.failExpected(.period);
const identifier = p.eatToken(.identifier); const identifier = p.eatToken(.identifier);
if (identifier == null) try p.warnExpected(.identifier); if (identifier == null) return p.failExpected(.identifier);
return try p.addNode(.{ return try p.addNode(.{
.tag = .error_value, .tag = .error_value,
.main_token = main_token, .main_token = main_token,

View File

@ -6280,7 +6280,6 @@ test "recovery: invalid global error set access" {
\\} \\}
, &[_]Error{ , &[_]Error{
.expected_token, .expected_token,
.expected_token,
}); });
} }