refactor semantic tokens

This commit is contained in:
Techatrix
2023-03-12 17:31:17 +01:00
committed by Lee Cannon
parent bbc082d102
commit 865e5efe8b
3 changed files with 126 additions and 130 deletions

View File

@@ -614,6 +614,16 @@ fn allDigits(str: []const u8) bool {
return true;
}
pub fn isValueIdent(text: []const u8) bool {
const PrimitiveTypes = std.ComptimeStringMap(void, .{
.{"true"},
.{"false"},
.{"null"},
.{"undefined"},
});
return PrimitiveTypes.has(text);
}
pub fn isTypeIdent(text: []const u8) bool {
const PrimitiveTypes = std.ComptimeStringMap(void, .{
.{"isize"}, .{"usize"},