mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 13:58:27 +00:00
stage2: no '$' in anonymous decl names
This way it will not cause a compile error for the C backend.
This commit is contained in:
parent
6ac2047142
commit
e7c4d545cd
@ -3216,17 +3216,17 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) InnerError!vo
|
||||
if (is_exported) {
|
||||
const i = iter.usingnamespace_index;
|
||||
iter.usingnamespace_index += 1;
|
||||
break :name try std.fmt.allocPrintZ(gpa, "usingnamespace${d}", .{i});
|
||||
break :name try std.fmt.allocPrintZ(gpa, "usingnamespace_{d}", .{i});
|
||||
} else {
|
||||
const i = iter.comptime_index;
|
||||
iter.comptime_index += 1;
|
||||
break :name try std.fmt.allocPrintZ(gpa, "comptime${d}", .{i});
|
||||
break :name try std.fmt.allocPrintZ(gpa, "comptime_{d}", .{i});
|
||||
}
|
||||
},
|
||||
1 => name: {
|
||||
const i = iter.unnamed_test_index;
|
||||
iter.unnamed_test_index += 1;
|
||||
break :name try std.fmt.allocPrintZ(gpa, "test${d}", .{i});
|
||||
break :name try std.fmt.allocPrintZ(gpa, "test_{d}", .{i});
|
||||
},
|
||||
else => zir.nullTerminatedString(decl_name_index),
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user