Wrap floats in token trees in FLOAT_LITERAL node

This commit is contained in:
Jonas Schievink 2022-05-04 19:25:32 +02:00
parent 90bd99f1bb
commit 34dc8e9383
6 changed files with 33 additions and 22 deletions

View file

@ -31,6 +31,9 @@ pub(super) fn token(sema: &Semantics<RootDatabase>, token: SyntaxToken) -> Optio
SymbolKind::Field.into()
}
INT_NUMBER | FLOAT_NUMBER_PART => HlTag::NumericLiteral.into(),
DOT if token.parent().map(|n| n.kind()) == Some(FLOAT_LITERAL) => {
HlTag::NumericLiteral.into()
}
BYTE => HlTag::ByteLiteral.into(),
CHAR => HlTag::CharLiteral.into(),
IDENT if token.parent().and_then(ast::TokenTree::cast).is_some() => {