mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
Add typeOf/TypeOf substition in zig fmt
This commit is contained in:
parent
cd4d638d10
commit
20a3011def
@ -1249,7 +1249,13 @@ fn renderExpression(
|
||||
.BuiltinCall => {
|
||||
const builtin_call = @fieldParentPtr(ast.Node.BuiltinCall, "base", base);
|
||||
|
||||
try renderToken(tree, stream, builtin_call.builtin_token, indent, start_col, Space.None); // @name
|
||||
// TODO: Remove condition after deprecating 'typeOf'. See https://github.com/ziglang/zig/issues/1348
|
||||
if (mem.eql(u8, tree.tokenSlicePtr(tree.tokens.at(builtin_call.builtin_token)), "@typeOf")) {
|
||||
try stream.write("@TypeOf");
|
||||
} else {
|
||||
try renderToken(tree, stream, builtin_call.builtin_token, indent, start_col, Space.None); // @name
|
||||
}
|
||||
|
||||
try renderToken(tree, stream, tree.nextToken(builtin_call.builtin_token), indent, start_col, Space.None); // (
|
||||
|
||||
var it = builtin_call.params.iterator(0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user