aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-05-07 16:18:49 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-05-07 16:18:49 -0700
commite7c4d545cd34321c61b85f1ce286d46976293617 (patch)
tree852d84353584fcbc11bdabebbabf3602b1b6b41d /src
parent6ac204714236eaeaea5dc66afddbe158966b2532 (diff)
downloadzig-e7c4d545cd34321c61b85f1ce286d46976293617.tar.gz
zig-e7c4d545cd34321c61b85f1ce286d46976293617.zip
stage2: no '$' in anonymous decl names
This way it will not cause a compile error for the C backend.
Diffstat (limited to 'src')
-rw-r--r--src/Module.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 1b935f65a9..3d0f22b46c 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -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),
};