pub fn isValidId(bytes: []const u8) bool bytes: []const u8655
656
657
658
659
660
661
662
663
664
665pub fn isValidId(bytes: []const u8) bool {
if (bytes.len == 0) return false;
for (bytes, 0..) |c, i| {
switch (c) {
'_', 'a'...'z', 'A'...'Z' => {},
'0'...'9' => if (i == 0) return false,
else => return false,
}
}
return Token.getKeyword(bytes) == null;
}