mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-16 00:20:46 +00:00
Indicate the number of float tokens in the first token
This commit is contained in:
parent
34dc8e9383
commit
2fe38d3b63
16 changed files with 194 additions and 44 deletions
|
@ -373,7 +373,9 @@ Literal =
|
|||
)
|
||||
|
||||
FloatLiteral =
|
||||
'float_number_part'
|
||||
'float_number_start_0'?
|
||||
'float_number_start_1'?
|
||||
'float_number_start_2'?
|
||||
'.'?
|
||||
'float_number_part'?
|
||||
|
||||
|
|
|
@ -1090,10 +1090,19 @@ pub struct FloatLiteral {
|
|||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
impl FloatLiteral {
|
||||
pub fn float_number_start_0_token(&self) -> Option<SyntaxToken> {
|
||||
support::token(&self.syntax, T![float_number_start_0])
|
||||
}
|
||||
pub fn float_number_start_1_token(&self) -> Option<SyntaxToken> {
|
||||
support::token(&self.syntax, T![float_number_start_1])
|
||||
}
|
||||
pub fn float_number_start_2_token(&self) -> Option<SyntaxToken> {
|
||||
support::token(&self.syntax, T![float_number_start_2])
|
||||
}
|
||||
pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
|
||||
pub fn float_number_part_token(&self) -> Option<SyntaxToken> {
|
||||
support::token(&self.syntax, T![float_number_part])
|
||||
}
|
||||
pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
|
|
|
@ -71,7 +71,17 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
|
|||
"super", "trait", "true", "try", "type", "unsafe", "use", "where", "while", "yield",
|
||||
],
|
||||
contextual_keywords: &["auto", "default", "existential", "union", "raw", "macro_rules"],
|
||||
literals: &["INT_NUMBER", "FLOAT_NUMBER_PART", "CHAR", "BYTE", "STRING", "BYTE_STRING"],
|
||||
literals: &[
|
||||
"INT_NUMBER",
|
||||
"FLOAT_NUMBER_START_0",
|
||||
"FLOAT_NUMBER_START_1",
|
||||
"FLOAT_NUMBER_START_2",
|
||||
"FLOAT_NUMBER_PART",
|
||||
"CHAR",
|
||||
"BYTE",
|
||||
"STRING",
|
||||
"BYTE_STRING",
|
||||
],
|
||||
tokens: &["ERROR", "IDENT", "WHITESPACE", "LIFETIME_IDENT", "COMMENT", "SHEBANG"],
|
||||
nodes: &[
|
||||
"SOURCE_FILE",
|
||||
|
|
|
@ -463,6 +463,9 @@ fn generate_syntax_kinds(grammar: KindsSrc<'_>) -> String {
|
|||
[ident] => { $crate::SyntaxKind::IDENT };
|
||||
[shebang] => { $crate::SyntaxKind::SHEBANG };
|
||||
[float_number_part] => { $crate::SyntaxKind::FLOAT_NUMBER_PART };
|
||||
[float_number_start_0] => { $crate::SyntaxKind::FLOAT_NUMBER_START_0 };
|
||||
[float_number_start_1] => { $crate::SyntaxKind::FLOAT_NUMBER_START_1 };
|
||||
[float_number_start_2] => { $crate::SyntaxKind::FLOAT_NUMBER_START_2 };
|
||||
}
|
||||
pub use T;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue