mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
string is not a keyword
This commit is contained in:
parent
7011094685
commit
b8cac1bb6b
5 changed files with 13 additions and 5 deletions
|
@ -19,6 +19,10 @@ impl Edition {
|
|||
pub fn at_least_2024(self) -> bool {
|
||||
self >= Edition::Edition2024
|
||||
}
|
||||
|
||||
pub fn at_least_2018(self) -> bool {
|
||||
self >= Edition::Edition2018
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
@ -178,6 +178,12 @@ impl<'a> Converter<'a> {
|
|||
rustc_lexer::TokenKind::Whitespace => WHITESPACE,
|
||||
|
||||
rustc_lexer::TokenKind::Ident if token_text == "_" => UNDERSCORE,
|
||||
rustc_lexer::TokenKind::Ident
|
||||
if ["async", "await", "dyn", "try"].contains(&token_text)
|
||||
&& !self.edition.at_least_2018() =>
|
||||
{
|
||||
IDENT
|
||||
}
|
||||
rustc_lexer::TokenKind::Ident
|
||||
if token_text == "gen" && !self.edition.at_least_2024() =>
|
||||
{
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -193,7 +193,7 @@ Fn =
|
|||
(body:BlockExpr | ';')
|
||||
|
||||
Abi =
|
||||
'extern' 'string'?
|
||||
'extern' '@string'?
|
||||
|
||||
ParamList =
|
||||
'('(
|
||||
|
|
|
@ -484,6 +484,7 @@ fn generate_syntax_kinds(grammar: KindsSrc) -> String {
|
|||
[lifetime_ident] => { $crate::SyntaxKind::LIFETIME_IDENT };
|
||||
[int_number] => { $crate::SyntaxKind::INT_NUMBER };
|
||||
[ident] => { $crate::SyntaxKind::IDENT };
|
||||
[string] => { $crate::SyntaxKind::STRING };
|
||||
[shebang] => { $crate::SyntaxKind::SHEBANG };
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue