| author | |
| committer | |
| log | f5b4b5d4cb3dec67805ac2120a24972592422cc7 |
| tree | 17077c127808aa1ea060008566eb7d7df068b989 |
| parent | c8a00c4b02c3cf095ce730e4cc92f1f999018836 |
integer types are valid ids; we need different logic inside the
update_cpu_features tool, not to change the fmtId function.1 files changed, 1 insertions(+), 12 deletions(-)
lib/std/zig/fmt.zig+1-12| ... | ... | @@ -32,18 +32,7 @@ pub fn isValidId(bytes: []const u8) bool { |
| 32 | 32 | else => return false, |
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | if (std.zig.Token.getKeyword(bytes) != null) return false; | |
| 36 | if (bytes.len >= 2) switch (bytes[0]) { | |
| 37 | 'u', 'i' => { | |
| 38 | for (bytes[1..]) |b| switch (b) { | |
| 39 | '0'...'9' => continue, | |
| 40 | else => break, | |
| 41 | } else return false; | |
| 42 | }, | |
| 43 | else => {}, | |
| 44 | }; | |
| 45 | ||
| 46 | return true; | |
| 35 | return std.zig.Token.getKeyword(bytes) == null; | |
| 47 | 36 | } |
| 48 | 37 | |
| 49 | 38 | test "isValidId" { |