| author | |
| committer | |
| log | d1908c9f661abebb2879b02c8ea3ac823fec27e7 |
| tree | 196949e92aa12da9ba30512acebb6505047c264a |
| parent | 264acfdf3caef663cddc39c2bf83818abb0e0073 |
| signature |
Co-authored-by: Philipp Lühmann <mail@philipp.lu>2 files changed, 6 insertions(+), 3 deletions(-)
lib/std/zig/parser_test.zig+3| ... | ... | @@ -2879,6 +2879,9 @@ test "zig fmt: functions" { |
| 2879 | 2879 | \\pub export fn puts(s: *const u8) align(2 + 2) c_int; |
| 2880 | 2880 | \\pub inline fn puts(s: *const u8) align(2 + 2) c_int; |
| 2881 | 2881 | \\pub noinline fn puts(s: *const u8) align(2 + 2) c_int; |
| 2882 | \\pub fn callInlineFn(func: fn () callconv(.Inline) void) void { | |
| 2883 | \\ func(); | |
| 2884 | \\} | |
| 2882 | 2885 | \\ |
| 2883 | 2886 | ); |
| 2884 | 2887 | } |
lib/std/zig/render.zig+3-3| ... | ... | @@ -1417,9 +1417,9 @@ fn renderFnProto(gpa: *Allocator, ais: *Ais, tree: Ast, fn_proto: Ast.full.FnPro |
| 1417 | 1417 | try renderToken(ais, tree, section_rparen, .space); // ) |
| 1418 | 1418 | } |
| 1419 | 1419 | |
| 1420 | if (fn_proto.ast.callconv_expr != 0 and | |
| 1421 | !mem.eql(u8, "Inline", tree.tokenSlice(tree.nodes.items(.main_token)[fn_proto.ast.callconv_expr]))) | |
| 1422 | { | |
| 1420 | const is_callconv_inline = mem.eql(u8, "Inline", tree.tokenSlice(tree.nodes.items(.main_token)[fn_proto.ast.callconv_expr])); | |
| 1421 | const is_declaration = fn_proto.name_token != null; | |
| 1422 | if (fn_proto.ast.callconv_expr != 0 and !(is_declaration and is_callconv_inline)) { | |
| 1423 | 1423 | const callconv_lparen = tree.firstToken(fn_proto.ast.callconv_expr) - 1; |
| 1424 | 1424 | const callconv_rparen = tree.lastToken(fn_proto.ast.callconv_expr) + 1; |
| 1425 | 1425 |