Skip to content

Commit 041eedc

Browse files
committed
zig init: appease zig fmt check
last commit introduced a templated variable name that made zig fmt angry
1 parent 1116d88 commit 041eedc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/init/src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const std = @import("std");
2-
const .NAME = @import(".NAME");
2+
const _LITNAME = @import(".NAME");
33

44
pub fn main() !void {
55
// Prints to stderr, ignoring potential errors.

src/main.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7426,6 +7426,12 @@ const Templates = struct {
74267426
}
74277427
if (templates.strip and contents[i] == '\n') {
74287428
new_line = true;
7429+
} else if (contents[i] == '_') {
7430+
if (std.mem.startsWith(u8, contents[i..], "_LITNAME")) {
7431+
try templates.buffer.appendSlice(root_name);
7432+
i += "_LITNAME".len;
7433+
continue;
7434+
}
74297435
} else if (contents[i] == '.') {
74307436
if (std.mem.startsWith(u8, contents[i..], ".LITNAME")) {
74317437
try templates.buffer.append('.');

0 commit comments

Comments
 (0)