mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
L: const & static keywords
This commit is contained in:
parent
f9ecc680f0
commit
049c9b60fb
4 changed files with 16 additions and 3 deletions
|
@ -21,7 +21,9 @@ Grammar(
|
||||||
"loop",
|
"loop",
|
||||||
"while",
|
"while",
|
||||||
"if",
|
"if",
|
||||||
"match"
|
"match",
|
||||||
|
"const",
|
||||||
|
"static",
|
||||||
],
|
],
|
||||||
tokens: [
|
tokens: [
|
||||||
"ERROR",
|
"ERROR",
|
||||||
|
|
|
@ -28,6 +28,8 @@ pub enum SyntaxKind {
|
||||||
WHILE_KW,
|
WHILE_KW,
|
||||||
IF_KW,
|
IF_KW,
|
||||||
MATCH_KW,
|
MATCH_KW,
|
||||||
|
CONST_KW,
|
||||||
|
STATIC_KW,
|
||||||
ERROR,
|
ERROR,
|
||||||
IDENT,
|
IDENT,
|
||||||
UNDERSCORE,
|
UNDERSCORE,
|
||||||
|
@ -137,6 +139,8 @@ impl SyntaxKind {
|
||||||
WHILE_KW => &SyntaxInfo { name: "WHILE_KW" },
|
WHILE_KW => &SyntaxInfo { name: "WHILE_KW" },
|
||||||
IF_KW => &SyntaxInfo { name: "IF_KW" },
|
IF_KW => &SyntaxInfo { name: "IF_KW" },
|
||||||
MATCH_KW => &SyntaxInfo { name: "MATCH_KW" },
|
MATCH_KW => &SyntaxInfo { name: "MATCH_KW" },
|
||||||
|
CONST_KW => &SyntaxInfo { name: "CONST_KW" },
|
||||||
|
STATIC_KW => &SyntaxInfo { name: "STATIC_KW" },
|
||||||
ERROR => &SyntaxInfo { name: "ERROR" },
|
ERROR => &SyntaxInfo { name: "ERROR" },
|
||||||
IDENT => &SyntaxInfo { name: "IDENT" },
|
IDENT => &SyntaxInfo { name: "IDENT" },
|
||||||
UNDERSCORE => &SyntaxInfo { name: "UNDERSCORE" },
|
UNDERSCORE => &SyntaxInfo { name: "UNDERSCORE" },
|
||||||
|
@ -242,6 +246,8 @@ pub(crate) fn ident_to_keyword(ident: &str) -> Option<SyntaxKind> {
|
||||||
"while" => Some(WHILE_KW),
|
"while" => Some(WHILE_KW),
|
||||||
"if" => Some(IF_KW),
|
"if" => Some(IF_KW),
|
||||||
"match" => Some(MATCH_KW),
|
"match" => Some(MATCH_KW),
|
||||||
|
"const" => Some(CONST_KW),
|
||||||
|
"static" => Some(STATIC_KW),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
fn use struct trait enum impl true false as extern crate mod pub self super in where for loop while if match
|
fn use struct trait enum impl true false as extern crate
|
||||||
|
mod pub self super in where for loop while if match const static
|
||||||
|
|
|
@ -19,7 +19,7 @@ WHITESPACE 1 " "
|
||||||
EXTERN_KW 6 "extern"
|
EXTERN_KW 6 "extern"
|
||||||
WHITESPACE 1 " "
|
WHITESPACE 1 " "
|
||||||
CRATE_KW 5 "crate"
|
CRATE_KW 5 "crate"
|
||||||
WHITESPACE 1 " "
|
WHITESPACE 1 "\n"
|
||||||
MOD_KW 3 "mod"
|
MOD_KW 3 "mod"
|
||||||
WHITESPACE 1 " "
|
WHITESPACE 1 " "
|
||||||
PUB_KW 3 "pub"
|
PUB_KW 3 "pub"
|
||||||
|
@ -41,4 +41,8 @@ WHITESPACE 1 " "
|
||||||
IF_KW 2 "if"
|
IF_KW 2 "if"
|
||||||
WHITESPACE 1 " "
|
WHITESPACE 1 " "
|
||||||
MATCH_KW 5 "match"
|
MATCH_KW 5 "match"
|
||||||
|
WHITESPACE 1 " "
|
||||||
|
CONST_KW 5 "const"
|
||||||
|
WHITESPACE 1 " "
|
||||||
|
STATIC_KW 6 "static"
|
||||||
WHITESPACE 1 "\n"
|
WHITESPACE 1 "\n"
|
||||||
|
|
Loading…
Reference in a new issue