pub fn isPrimitive(name: []const u8) bool name: []const u842
43
44
45
46
47
48
49
50
51
52pub fn isPrimitive(name: []const u8) bool {
if (names.get(name) != null) return true;
if (name.len < 2) return false;
const first_c = name[0];
if (first_c != 'i' and first_c != 'u') return false;
for (name[1..]) |c| switch (c) {
'0'...'9' => {},
else => return false,
};
return true;
}
Returns true if a name matches a primitive type or value, excluding
_. Integer type names likeu8ori32are only matched for syntax, so this will still return true when they have an oversized bit count or leading zeroes.