| author | |
| committer | |
| log | 241984987b394ea73ff17fa60846b1e0e85e3433 |
| tree | 5e9594566275324b297045333597ccd15d9f16aa |
| parent | e5ffb94911b23ed916b52a28d8d91aa3f9ebc171 |
| parent | 28d449b38d6bbf4081bed9fc58685fd5ca36423f |
| signature |
Fix zig fmt regression2 files changed, 11 insertions(+), 1 deletions(-)
lib/std/zig/parse.zig+1-1| ... | ... | @@ -732,7 +732,7 @@ fn parseIfStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node |
| 732 | 732 | |
| 733 | 733 | const block_expr = (try parseBlockExpr(arena, it, tree)); |
| 734 | 734 | const assign_expr = if (block_expr == null) |
| 735 | try expectNode(arena, it, tree, parseAdditionExpr, .{ | |
| 735 | try expectNode(arena, it, tree, parseAssignExpr, .{ | |
| 736 | 736 | .ExpectedBlockOrAssignment = .{ .token = it.index }, |
| 737 | 737 | }) |
| 738 | 738 | else |
lib/std/zig/parser_test.zig+10| ... | ... | @@ -208,6 +208,16 @@ test "recovery: invalid comptime" { |
| 208 | 208 | }); |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | test "zig fmt: if statment" { | |
| 212 | try testCanonical( | |
| 213 | \\test "" { | |
| 214 | \\ if (optional()) |some| | |
| 215 | \\ bar = some.foo(); | |
| 216 | \\} | |
| 217 | \\ | |
| 218 | ); | |
| 219 | } | |
| 220 | ||
| 211 | 221 | test "zig fmt: top-level fields" { |
| 212 | 222 | try testCanonical( |
| 213 | 223 | \\a: did_you_know, |