Revert "Don't remap float tokens to INT_NUMBER"

This reverts commit cb5e8da88a06be415bd804884284c11c0a709bcf.
This commit is contained in:
Jonas Schievink 2022-05-13 15:04:15 +02:00
parent da969635a4
commit 73e0e17b52
4 changed files with 4 additions and 10 deletions

View File

@ -104,7 +104,6 @@ macro_rules! id {
$($t)* $($t)*
}; };
} }
id! { id! {
#[proc_macros::identity] #[proc_macros::identity]
impl Foo for WrapBj { impl Foo for WrapBj {
@ -120,7 +119,6 @@ macro_rules! id {
$($t)* $($t)*
}; };
} }
#[proc_macros::identity] impl Foo for WrapBj { #[proc_macros::identity] impl Foo for WrapBj {
async fn foo(&self ) { async fn foo(&self ) {
self .0.id().await ; self .0.id().await ;

View File

@ -243,8 +243,6 @@ fn convert_tokens<C: TokenConvertor>(conv: &mut C) -> tt::Subtree {
let char = match token.to_char(conv) { let char = match token.to_char(conv) {
Some(c) => c, Some(c) => c,
None => { None => {
// FIXME: this isn't really correct, `to_char` yields the *first* char of the token,
// and this is relevant when eg. creating 2 `tt::Punct` from a single `::` token
panic!("Token from lexer must be single char: token = {:#?}", token); panic!("Token from lexer must be single char: token = {:#?}", token);
} }
}; };

View File

@ -324,9 +324,7 @@ fn name_ref_or_index(p: &mut Parser) {
); );
let m = p.start(); let m = p.start();
if p.at(FLOAT_NUMBER_PART) || p.at_ts(FLOAT_LITERAL_FIRST) { if p.at(FLOAT_NUMBER_PART) || p.at_ts(FLOAT_LITERAL_FIRST) {
// Ideally we'd remap this to `INT_NUMBER` instead, but that causes the MBE conversion to p.bump_remap(INT_NUMBER);
// lose track of what's a float and what isn't, causing panics.
p.bump_remap(FLOAT_NUMBER_PART);
} else { } else {
p.bump_any(); p.bump_any();
} }

View File

@ -50,7 +50,7 @@ SOURCE_FILE
IDENT "x" IDENT "x"
DOT "." DOT "."
NAME_REF NAME_REF
FLOAT_NUMBER_PART "0" INT_NUMBER "0"
DOT "." DOT "."
WHITESPACE " " WHITESPACE " "
NAME_REF NAME_REF
@ -67,10 +67,10 @@ SOURCE_FILE
IDENT "x" IDENT "x"
DOT "." DOT "."
NAME_REF NAME_REF
FLOAT_NUMBER_PART "0" INT_NUMBER "0"
DOT "." DOT "."
NAME_REF NAME_REF
FLOAT_NUMBER_PART "1" INT_NUMBER "1"
SEMICOLON ";" SEMICOLON ";"
WHITESPACE "\n " WHITESPACE "\n "
EXPR_STMT EXPR_STMT