mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
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.
This commit is contained in:
parent
c8a00c4b02
commit
f5b4b5d4cb
@ -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" {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user