diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-07-01 23:46:07 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-07-01 23:46:07 -0700 |
| commit | f5b4b5d4cb3dec67805ac2120a24972592422cc7 (patch) | |
| tree | 17077c127808aa1ea060008566eb7d7df068b989 /lib/std | |
| parent | c8a00c4b02c3cf095ce730e4cc92f1f999018836 (diff) | |
| download | zig-f5b4b5d4cb3dec67805ac2120a24972592422cc7.tar.gz zig-f5b4b5d4cb3dec67805ac2120a24972592422cc7.zip | |
std.zig.fmtId: revert recent changes
integer types are valid ids; we need different logic inside the
update_cpu_features tool, not to change the fmtId function.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/zig/fmt.zig | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/std/zig/fmt.zig b/lib/std/zig/fmt.zig index f9aebcc188..7ddad7ebcc 100644 --- a/lib/std/zig/fmt.zig +++ b/lib/std/zig/fmt.zig @@ -32,18 +32,7 @@ pub fn isValidId(bytes: []const u8) bool { else => return false, } } - if (std.zig.Token.getKeyword(bytes) != null) return false; - if (bytes.len >= 2) switch (bytes[0]) { - 'u', 'i' => { - for (bytes[1..]) |b| switch (b) { - '0'...'9' => continue, - else => break, - } else return false; - }, - else => {}, - }; - - return true; + return std.zig.Token.getKeyword(bytes) == null; } test "isValidId" { |
