mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Maybe everything else *should* have to deal with it
This commit is contained in:
parent
2fe38d3b63
commit
37443eb9a1
10 changed files with 34 additions and 39 deletions
|
@ -53,16 +53,14 @@ pub(crate) fn literal(p: &mut Parser) -> Option<CompletedMarker> {
|
|||
// }
|
||||
pub(crate) fn float_literal(p: &mut Parser) {
|
||||
// Floats can be up to 3 tokens. The first token indicates how many there are.
|
||||
// We remap the first token to `FLOAT_NUMBER_PART` so that no subsequent code has to deal with
|
||||
// this awful, awful hack.
|
||||
let f = p.start();
|
||||
if p.at(FLOAT_NUMBER_START_0) {
|
||||
p.bump_remap(FLOAT_NUMBER_PART);
|
||||
p.bump(FLOAT_NUMBER_START_0);
|
||||
} else if p.at(FLOAT_NUMBER_START_1) {
|
||||
p.bump_remap(FLOAT_NUMBER_PART);
|
||||
p.bump(FLOAT_NUMBER_START_1);
|
||||
p.bump(DOT);
|
||||
} else if p.at(FLOAT_NUMBER_START_2) {
|
||||
p.bump_remap(FLOAT_NUMBER_PART);
|
||||
p.bump(FLOAT_NUMBER_START_2);
|
||||
p.bump(DOT);
|
||||
p.bump(FLOAT_NUMBER_PART);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue