isCustomIdent static method
Implementation
static bool isCustomIdent(String token) {
if (token.isEmpty) return false;
final String lower = token.toLowerCase();
if (lower == 'auto' || lower == 'span') return false;
int i = 0;
if (token.codeUnitAt(0) == 0x2D /* - */) {
i++;
if (i >= token.length) return false;
}
final int first = token.codeUnitAt(i);
final bool firstOk = first == 0x5F /* _ */ ||
(first >= 0x41 && first <= 0x5A) ||
(first >= 0x61 && first <= 0x7A);
if (!firstOk) return false;
for (i = i + 1; i < token.length; i++) {
final int cu = token.codeUnitAt(i);
final bool ok = cu == 0x5F /* _ */ ||
cu == 0x2D /* - */ ||
(cu >= 0x30 && cu <= 0x39) ||
(cu >= 0x41 && cu <= 0x5A) ||
(cu >= 0x61 && cu <= 0x7A);
if (!ok) return false;
}
return true;
}