while (true) {
!break;
}
while (true) {
--break;
}
while (true) {
1 + break;
}
All three pass the grammar as defined in grammar.y, and I believe the first two have no impact on actual zig compilation results. The third one fails the zig compiler due to unreachable code (it considers the 1 + to be unreachable)
PrimaryExpr is the relevant rule. All of the binary and unary operations coming in from PrefixExpr on the left-hand-side is what allows for this unexpected grammar.
All three pass the grammar as defined in
grammar.y
, and I believe the first two have no impact on actual zig compilation results. The third one fails the zig compiler due to unreachable code (it considers the1 +
to be unreachable)PrimaryExpr
is the relevant rule. All of the binary and unary operations coming in fromPrefixExpr
on the left-hand-side is what allows for this unexpected grammar.