We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b0556e commit 841ac0fCopy full SHA for 841ac0f
std/zig/parser.zig
@@ -2036,7 +2036,7 @@ pub const Parser = struct {
2036
);
2037
try list_state.list.append(node);
2038
stack.append(State { .SwitchCaseCommaOrEnd = list_state }) catch unreachable;
2039
- try stack.append(State { .Expression = DestPtr{ .Field = &node.expr } });
+ try stack.append(State { .AssignmentExpressionBegin = DestPtr{ .Field = &node.expr } });
2040
try stack.append(State { .PointerPayload = &node.payload });
2041
2042
const maybe_else = self.getNextToken();
@@ -4817,6 +4817,7 @@ test "zig fmt: switch" {
4817
\\ const res = switch (0) {
4818
\\ 0 => 0,
4819
\\ 1 => 2,
4820
+ \\ 1 => a = 4,
4821
\\ else => 4
4822
\\ };
4823
\\
0 commit comments