mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
G: use names in consts
This commit is contained in:
parent
1401f5af4a
commit
f746fb6a93
3 changed files with 13 additions and 9 deletions
|
@ -12,7 +12,7 @@ fn const_or_static(p: &mut Parser, kw: SyntaxKind) {
|
|||
assert!(p.at(kw));
|
||||
p.bump();
|
||||
p.eat(MUT_KW); // TODO: validator to forbid const mut
|
||||
p.expect(IDENT);
|
||||
name(p);
|
||||
p.expect(COLON);
|
||||
types::type_ref(p);
|
||||
p.expect(EQ);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
FILE@[0; 47)
|
||||
STATIC_ITEM@[0; 21)
|
||||
STATIC_KW@[0; 6)
|
||||
NAME@[6; 10)
|
||||
WHITESPACE@[6; 7)
|
||||
IDENT@[7; 10) "FOO"
|
||||
COLON@[10; 11)
|
||||
|
@ -17,6 +18,7 @@ FILE@[0; 47)
|
|||
STATIC_KW@[21; 27)
|
||||
WHITESPACE@[27; 28)
|
||||
MUT_KW@[28; 31)
|
||||
NAME@[31; 35)
|
||||
WHITESPACE@[31; 32)
|
||||
IDENT@[32; 35) "BAR"
|
||||
COLON@[35; 36)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
FILE@[0; 46)
|
||||
CONST_ITEM@[0; 21)
|
||||
CONST_KW@[0; 5)
|
||||
NAME@[5; 9)
|
||||
WHITESPACE@[5; 6)
|
||||
IDENT@[6; 9) "FOO"
|
||||
COLON@[9; 10)
|
||||
|
@ -17,6 +18,7 @@ FILE@[0; 46)
|
|||
CONST_KW@[21; 26)
|
||||
WHITESPACE@[26; 27)
|
||||
MUT_KW@[27; 30)
|
||||
NAME@[30; 34)
|
||||
WHITESPACE@[30; 31)
|
||||
IDENT@[31; 34) "BAR"
|
||||
COLON@[34; 35)
|
||||
|
|
Loading…
Reference in a new issue