Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 73e0e17

Browse files
author
Jonas Schievink
committed
Revert "Don't remap float tokens to INT_NUMBER"
This reverts commit cb5e8da.
1 parent da96963 commit 73e0e17

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

crates/hir-def/src/macro_expansion_tests/proc_macros.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ macro_rules! id {
104104
$($t)*
105105
};
106106
}
107-
108107
id! {
109108
#[proc_macros::identity]
110109
impl Foo for WrapBj {
@@ -120,7 +119,6 @@ macro_rules! id {
120119
$($t)*
121120
};
122121
}
123-
124122
#[proc_macros::identity] impl Foo for WrapBj {
125123
async fn foo(&self ) {
126124
self .0.id().await ;

crates/mbe/src/syntax_bridge.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,6 @@ fn convert_tokens<C: TokenConvertor>(conv: &mut C) -> tt::Subtree {
243243
let char = match token.to_char(conv) {
244244
Some(c) => c,
245245
None => {
246-
// FIXME: this isn't really correct, `to_char` yields the *first* char of the token,
247-
// and this is relevant when eg. creating 2 `tt::Punct` from a single `::` token
248246
panic!("Token from lexer must be single char: token = {:#?}", token);
249247
}
250248
};

crates/parser/src/grammar.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,7 @@ fn name_ref_or_index(p: &mut Parser) {
324324
);
325325
let m = p.start();
326326
if p.at(FLOAT_NUMBER_PART) || p.at_ts(FLOAT_LITERAL_FIRST) {
327-
// Ideally we'd remap this to `INT_NUMBER` instead, but that causes the MBE conversion to
328-
// lose track of what's a float and what isn't, causing panics.
329-
p.bump_remap(FLOAT_NUMBER_PART);
327+
p.bump_remap(INT_NUMBER);
330328
} else {
331329
p.bump_any();
332330
}

crates/parser/test_data/parser/inline/ok/0011_field_expr.rast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ SOURCE_FILE
5050
IDENT "x"
5151
DOT "."
5252
NAME_REF
53-
FLOAT_NUMBER_PART "0"
53+
INT_NUMBER "0"
5454
DOT "."
5555
WHITESPACE " "
5656
NAME_REF
@@ -67,10 +67,10 @@ SOURCE_FILE
6767
IDENT "x"
6868
DOT "."
6969
NAME_REF
70-
FLOAT_NUMBER_PART "0"
70+
INT_NUMBER "0"
7171
DOT "."
7272
NAME_REF
73-
FLOAT_NUMBER_PART "1"
73+
INT_NUMBER "1"
7474
SEMICOLON ";"
7575
WHITESPACE "\n "
7676
EXPR_STMT

0 commit comments

Comments
 (0)