mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-10 02:59:56 +00:00
Don't remap float tokens to INT_NUMBER
This commit is contained in:
parent
f8c0062d4e
commit
cb5e8da88a
4 changed files with 45 additions and 4 deletions
|
|
@ -324,7 +324,9 @@ fn name_ref_or_index(p: &mut Parser) {
|
|||
);
|
||||
let m = p.start();
|
||||
if p.at(FLOAT_NUMBER_PART) || p.at_ts(FLOAT_LITERAL_FIRST) {
|
||||
p.bump_remap(INT_NUMBER);
|
||||
// Ideally we'd remap this to `INT_NUMBER` instead, but that causes the MBE conversion to
|
||||
// lose track of what's a float and what isn't, causing panics.
|
||||
p.bump_remap(FLOAT_NUMBER_PART);
|
||||
} else {
|
||||
p.bump_any();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ SOURCE_FILE
|
|||
IDENT "x"
|
||||
DOT "."
|
||||
NAME_REF
|
||||
INT_NUMBER "0"
|
||||
FLOAT_NUMBER_PART "0"
|
||||
DOT "."
|
||||
WHITESPACE " "
|
||||
NAME_REF
|
||||
|
|
@ -67,10 +67,10 @@ SOURCE_FILE
|
|||
IDENT "x"
|
||||
DOT "."
|
||||
NAME_REF
|
||||
INT_NUMBER "0"
|
||||
FLOAT_NUMBER_PART "0"
|
||||
DOT "."
|
||||
NAME_REF
|
||||
INT_NUMBER "1"
|
||||
FLOAT_NUMBER_PART "1"
|
||||
SEMICOLON ";"
|
||||
WHITESPACE "\n "
|
||||
EXPR_STMT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue