analysis- clean up isTypeIdent

This commit is contained in:
Meghan Denny 2021-09-30 18:46:14 -07:00
parent 4bc8b92e19
commit 50022e5d24

View File

@ -620,10 +620,10 @@ pub fn isTypeIdent(tree: Analysis.Tree, token_idx: Ast.TokenIndex) bool {
const text = tree.tokenSlice(token_idx);
if (PrimitiveTypes.has(text)) return true;
if (text.len > 1 and (text[0] == 'u' or text[0] == 'i') and allDigits(text[1..]))
return true;
return false;
if (text.len == 1) return false;
if (!(text[0] == 'u' or text[0] == 'i')) return false;
if (!allDigits(text[1..])) return false;
return true;
}
/// Resolves the type of a node