mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 13:18:47 +00:00
Lexer: literal suffixes
This commit is contained in:
parent
d6a922459e
commit
0b49db623f
3 changed files with 13 additions and 4 deletions
|
@ -152,7 +152,10 @@ fn scan_char_or_lifetime(ptr: &mut Ptr) -> SyntaxKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn scan_literal_suffix(ptr: &mut Ptr) {
|
fn scan_literal_suffix(ptr: &mut Ptr) {
|
||||||
|
if ptr.next_is_p(is_ident_start) {
|
||||||
|
ptr.bump();
|
||||||
|
}
|
||||||
|
ptr.bump_while(is_ident_continue);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn scan_char_or_byte(ptr: &mut Ptr) {
|
fn scan_char_or_byte(ptr: &mut Ptr) {
|
||||||
|
|
|
@ -6,3 +6,4 @@
|
||||||
0.e+1
|
0.e+1
|
||||||
0.0E-2
|
0.0E-2
|
||||||
0___0.10000____0000e+111__
|
0___0.10000____0000e+111__
|
||||||
|
1i64 92.0f32 11__s
|
|
@ -16,8 +16,7 @@ INT_NUMBER 2 "0e"
|
||||||
WHITESPACE 1 " "
|
WHITESPACE 1 " "
|
||||||
INT_NUMBER 2 "0E"
|
INT_NUMBER 2 "0E"
|
||||||
WHITESPACE 1 " "
|
WHITESPACE 1 " "
|
||||||
INT_NUMBER 1 "0"
|
INT_NUMBER 2 "0z"
|
||||||
IDENT 1 "z"
|
|
||||||
WHITESPACE 1 "\n"
|
WHITESPACE 1 "\n"
|
||||||
INT_NUMBER 5 "01790"
|
INT_NUMBER 5 "01790"
|
||||||
WHITESPACE 1 " "
|
WHITESPACE 1 " "
|
||||||
|
@ -60,3 +59,9 @@ WHITESPACE 1 "\n"
|
||||||
FLOAT_NUMBER 6 "0.0E-2"
|
FLOAT_NUMBER 6 "0.0E-2"
|
||||||
WHITESPACE 1 "\n"
|
WHITESPACE 1 "\n"
|
||||||
FLOAT_NUMBER 26 "0___0.10000____0000e+111__"
|
FLOAT_NUMBER 26 "0___0.10000____0000e+111__"
|
||||||
|
WHITESPACE 1 "\n"
|
||||||
|
INT_NUMBER 4 "1i64"
|
||||||
|
WHITESPACE 1 " "
|
||||||
|
FLOAT_NUMBER 7 "92.0f32"
|
||||||
|
WHITESPACE 1 " "
|
||||||
|
INT_NUMBER 5 "11__s"
|
||||||
|
|
Loading…
Reference in a new issue