mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
bail when failing to parse error
This commit is contained in:
parent
dd75e7bcb1
commit
a74119ac49
@ -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,
|
||||||
|
|||||||
@ -6280,7 +6280,6 @@ test "recovery: invalid global error set access" {
|
|||||||
\\}
|
\\}
|
||||||
, &[_]Error{
|
, &[_]Error{
|
||||||
.expected_token,
|
.expected_token,
|
||||||
.expected_token,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user