mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
bail when failing to parse error
This commit is contained in:
parent
dd75e7bcb1
commit
a74119ac49
2 changed files with 2 additions and 3 deletions
|
|
@ -2774,9 +2774,9 @@ fn parsePrimaryTypeExpr(p: *Parse) !?Node.Index {
|
|||
else => {
|
||||
const main_token = p.nextToken();
|
||||
const period = p.eatToken(.period);
|
||||
if (period == null) try p.warnExpected(.period);
|
||||
if (period == null) return p.failExpected(.period);
|
||||
const identifier = p.eatToken(.identifier);
|
||||
if (identifier == null) try p.warnExpected(.identifier);
|
||||
if (identifier == null) return p.failExpected(.identifier);
|
||||
return try p.addNode(.{
|
||||
.tag = .error_value,
|
||||
.main_token = main_token,
|
||||
|
|
|
|||
|
|
@ -6280,7 +6280,6 @@ test "recovery: invalid global error set access" {
|
|||
\\}
|
||||
, &[_]Error{
|
||||
.expected_token,
|
||||
.expected_token,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue