mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 00:08:56 +00:00
zig fmt: function with labeled block as return type
This commit is contained in:
parent
c79ee1fc8d
commit
9ada7638a5
@ -2656,6 +2656,10 @@ const Parser = struct {
|
||||
p.tok_i += 2;
|
||||
return p.parseWhileTypeExpr();
|
||||
},
|
||||
.l_brace => {
|
||||
p.tok_i += 2;
|
||||
return p.parseBlock();
|
||||
},
|
||||
else => return p.addNode(.{
|
||||
.tag = .identifier,
|
||||
.main_token = p.nextToken(),
|
||||
|
||||
@ -4179,6 +4179,17 @@ test "zig fmt: proper indent line comment after multi-line single expr while loo
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: function with labeled block as return type" {
|
||||
try testCanonical(
|
||||
\\fn foo() t: {
|
||||
\\ break :t bar;
|
||||
\\} {
|
||||
\\ baz();
|
||||
\\}
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: line comment after multiline single expr if statement with multiline string" {
|
||||
try testCanonical(
|
||||
\\test {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user