The code which parses integer suffixes recognizes the suffixes: u8, i8, u16, i16, u32, i32, u64, i64, usize and isize, but not u128 and i128, so integer literals like 10u128 or 0xffffi128 are marked as errors.
|
/* Scan initial digits. The literal is malformed if there are none. */ |
|
error |= !ScanDigits(styler, pos, base); |
|
/* See if there's an integer suffix. We mimic the Rust's lexer |
|
* and munch it even if there was an error above. */ |
|
c = styler.SafeGetCharAt(pos, '\0'); |
|
if (c == 'u' || c == 'i') { |
|
pos++; |
|
c = styler.SafeGetCharAt(pos, '\0'); |
|
n = styler.SafeGetCharAt(pos + 1, '\0'); |
|
if (c == '8') { |
|
pos++; |
|
} else if (c == '1' && n == '6') { |
|
pos += 2; |
|
} else if (c == '3' && n == '2') { |
|
pos += 2; |
|
} else if (c == '6' && n == '4') { |
|
pos += 2; |
|
} else if (styler.Match(pos, "size")) { |
|
pos += 4; |
|
} else { |
|
error = true; |
|
} |
The code which parses integer suffixes recognizes the suffixes:
u8,i8,u16,i16,u32,i32,u64,i64,usizeandisize, but notu128andi128, so integer literals like10u128or0xffffi128are marked as errors.lexilla/lexers/LexRust.cxx
Lines 272 to 293 in 782725a