mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +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,8 +1,9 @@
|
|||
FILE@[0; 47)
|
||||
STATIC_ITEM@[0; 21)
|
||||
STATIC_KW@[0; 6)
|
||||
WHITESPACE@[6; 7)
|
||||
IDENT@[7; 10) "FOO"
|
||||
NAME@[6; 10)
|
||||
WHITESPACE@[6; 7)
|
||||
IDENT@[7; 10) "FOO"
|
||||
COLON@[10; 11)
|
||||
WHITESPACE@[11; 12)
|
||||
IDENT@[12; 15) "u32"
|
||||
|
@ -17,8 +18,9 @@ FILE@[0; 47)
|
|||
STATIC_KW@[21; 27)
|
||||
WHITESPACE@[27; 28)
|
||||
MUT_KW@[28; 31)
|
||||
WHITESPACE@[31; 32)
|
||||
IDENT@[32; 35) "BAR"
|
||||
NAME@[31; 35)
|
||||
WHITESPACE@[31; 32)
|
||||
IDENT@[32; 35) "BAR"
|
||||
COLON@[35; 36)
|
||||
WHITESPACE@[36; 37)
|
||||
IDENT@[37; 40) "i32"
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
FILE@[0; 46)
|
||||
CONST_ITEM@[0; 21)
|
||||
CONST_KW@[0; 5)
|
||||
WHITESPACE@[5; 6)
|
||||
IDENT@[6; 9) "FOO"
|
||||
NAME@[5; 9)
|
||||
WHITESPACE@[5; 6)
|
||||
IDENT@[6; 9) "FOO"
|
||||
COLON@[9; 10)
|
||||
WHITESPACE@[10; 11)
|
||||
IDENT@[11; 14) "u32"
|
||||
|
@ -17,8 +18,9 @@ FILE@[0; 46)
|
|||
CONST_KW@[21; 26)
|
||||
WHITESPACE@[26; 27)
|
||||
MUT_KW@[27; 30)
|
||||
WHITESPACE@[30; 31)
|
||||
IDENT@[31; 34) "BAR"
|
||||
NAME@[30; 34)
|
||||
WHITESPACE@[30; 31)
|
||||
IDENT@[31; 34) "BAR"
|
||||
COLON@[34; 35)
|
||||
WHITESPACE@[35; 36)
|
||||
IDENT@[36; 39) "u32"
|
||||
|
|
Loading…
Reference in a new issue