| author | |
| committer | |
| log | 3290e728339e49765b1adda78f173befb9fc12bf |
| tree | c03bec671475f6a0e73d724715de6c95accaa799 |
| parent | 8866bef92c8b674c2a444c94326c57984597ab05 |
closes #11512 files changed, 10 insertions(+), 0 deletions(-)
std/zig/ast.zig+1| ... | ... | @@ -858,6 +858,7 @@ pub const Node = struct { |
| 858 | 858 | |
| 859 | 859 | pub fn firstToken(self: *FnProto) TokenIndex { |
| 860 | 860 | if (self.visib_token) |visib_token| return visib_token; |
| 861 | if (self.async_attr) |async_attr| return async_attr.firstToken(); | |
| 861 | 862 | if (self.extern_export_inline_token) |extern_export_inline_token| return extern_export_inline_token; |
| 862 | 863 | assert(self.lib_name == null); |
| 863 | 864 | if (self.cc_token) |cc_token| return cc_token; |
std/zig/parser_test.zig+9| ... | ... | @@ -1,3 +1,12 @@ |
| 1 | test "zig fmt: preserve space between async fn definitions" { | |
| 2 | try testCanonical( | |
| 3 | \\async fn a() void {} | |
| 4 | \\ | |
| 5 | \\async fn b() void {} | |
| 6 | \\ | |
| 7 | ); | |
| 8 | } | |
| 9 | ||
| 1 | 10 | test "zig fmt: comment to disable/enable zig fmt first" { |
| 2 | 11 | try testCanonical( |
| 3 | 12 | \\// Test trailing comma syntax |