| ... | @@ -1515,17 +1515,23 @@ pub const Parser = struct { | ... | @@ -1515,17 +1515,23 @@ pub const Parser = struct { |
| 1515 | continue; | 1515 | continue; |
| 1516 | }, | 1516 | }, |
| 1517 | Token.Id.Period => { | 1517 | Token.Id.Period => { |
| | 1518 | const identifier = try self.createLiteral(arena, ast.NodeIdentifier, Token(undefined)); |
| 1518 | const node = try self.createToDestNode(arena, dest_ptr, ast.NodeInfixOp, | 1519 | const node = try self.createToDestNode(arena, dest_ptr, ast.NodeInfixOp, |
| 1519 | ast.NodeInfixOp { | 1520 | ast.NodeInfixOp { |
| 1520 | .base = undefined, | 1521 | .base = undefined, |
| 1521 | .lhs = dest_ptr.get(), | 1522 | .lhs = dest_ptr.get(), |
| 1522 | .op_token = token, | 1523 | .op_token = token, |
| 1523 | .op = ast.NodeInfixOp.InfixOp.Period, | 1524 | .op = ast.NodeInfixOp.InfixOp.Period, |
| 1524 | .rhs = undefined, | 1525 | .rhs = &identifier.base, |
| 1525 | } | 1526 | } |
| 1526 | ); | 1527 | ); |
| 1527 | stack.append(State { .SuffixOpExpressionEnd = dest_ptr }) catch unreachable; | 1528 | stack.append(State { .SuffixOpExpressionEnd = dest_ptr }) catch unreachable; |
| 1528 | try stack.append(State { .SuffixOpExpressionBegin = DestPtr { .Field = &node.rhs }}); | 1529 | try stack.append(State { |
| | 1530 | .ExpectTokenSave = ExpectTokenSave { |
| | 1531 | .id = Token.Id.Identifier, |
| | 1532 | .ptr = &identifier.token |
| | 1533 | } |
| | 1534 | }); |
| 1529 | continue; | 1535 | continue; |
| 1530 | }, | 1536 | }, |
| 1531 | else => { | 1537 | else => { |
| ... | @@ -5011,6 +5017,7 @@ test "zig fmt: inline asm" { | ... | @@ -5011,6 +5017,7 @@ test "zig fmt: inline asm" { |
| 5011 | test "zig fmt: coroutines" { | 5017 | test "zig fmt: coroutines" { |
| 5012 | try testCanonical( | 5018 | try testCanonical( |
| 5013 | \\async fn simpleAsyncFn() void { | 5019 | \\async fn simpleAsyncFn() void { |
| | 5020 | \\ const a = async a.b(); |
| 5014 | \\ x += 1; | 5021 | \\ x += 1; |
| 5015 | \\ suspend; | 5022 | \\ suspend; |
| 5016 | \\ x += 1; | 5023 | \\ x += 1; |