mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 17:28:09 +00:00
number field
This commit is contained in:
parent
5b43010083
commit
c8e5901275
3 changed files with 36 additions and 23 deletions
|
@ -210,7 +210,8 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
|
|||
|
||||
// test field_expr
|
||||
// fn foo() {
|
||||
// x.foo.bar;
|
||||
// x.foo;
|
||||
// x.0.bar;
|
||||
// }
|
||||
fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
|
||||
assert!(p.at(DOT) && (p.nth(1) == IDENT || p.nth(1) == INT_NUMBER));
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
fn foo() {
|
||||
x.foo.bar;
|
||||
x.foo;
|
||||
x.0.bar;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
FILE@[0; 28)
|
||||
FN_ITEM@[0; 28)
|
||||
FILE@[0; 37)
|
||||
FN_ITEM@[0; 37)
|
||||
FN_KW@[0; 2)
|
||||
NAME@[2; 6)
|
||||
WHITESPACE@[2; 3)
|
||||
|
@ -8,24 +8,35 @@ FILE@[0; 28)
|
|||
L_PAREN@[6; 7)
|
||||
R_PAREN@[7; 8)
|
||||
WHITESPACE@[8; 9)
|
||||
BLOCK@[9; 28)
|
||||
BLOCK@[9; 37)
|
||||
L_CURLY@[9; 10)
|
||||
EXPR_STMT@[10; 26)
|
||||
FIELD_EXPR@[10; 24)
|
||||
FIELD_EXPR@[10; 20)
|
||||
PATH_EXPR@[10; 16)
|
||||
PATH@[10; 16)
|
||||
PATH_SEGMENT@[10; 16)
|
||||
NAME_REF@[10; 16)
|
||||
WHITESPACE@[10; 15)
|
||||
IDENT@[15; 16) "x"
|
||||
DOT@[16; 17)
|
||||
NAME_REF@[17; 20)
|
||||
IDENT@[17; 20) "foo"
|
||||
DOT@[20; 21)
|
||||
NAME_REF@[21; 24)
|
||||
IDENT@[21; 24) "bar"
|
||||
SEMI@[24; 25)
|
||||
WHITESPACE@[25; 26)
|
||||
R_CURLY@[26; 27)
|
||||
WHITESPACE@[27; 28)
|
||||
FIELD_EXPR@[10; 20)
|
||||
PATH_EXPR@[10; 16)
|
||||
PATH@[10; 16)
|
||||
PATH_SEGMENT@[10; 16)
|
||||
NAME_REF@[10; 16)
|
||||
WHITESPACE@[10; 15)
|
||||
IDENT@[15; 16) "x"
|
||||
DOT@[16; 17)
|
||||
NAME_REF@[17; 20)
|
||||
IDENT@[17; 20) "foo"
|
||||
SEMI@[20; 21)
|
||||
WHITESPACE@[21; 26)
|
||||
EXPR_STMT@[26; 35)
|
||||
FIELD_EXPR@[26; 33)
|
||||
FIELD_EXPR@[26; 29)
|
||||
PATH_EXPR@[26; 27)
|
||||
PATH@[26; 27)
|
||||
PATH_SEGMENT@[26; 27)
|
||||
NAME_REF@[26; 27)
|
||||
IDENT@[26; 27) "x"
|
||||
DOT@[27; 28)
|
||||
INT_NUMBER@[28; 29)
|
||||
DOT@[29; 30)
|
||||
NAME_REF@[30; 33)
|
||||
IDENT@[30; 33) "bar"
|
||||
SEMI@[33; 34)
|
||||
WHITESPACE@[34; 35)
|
||||
R_CURLY@[35; 36)
|
||||
WHITESPACE@[36; 37)
|
||||
|
|
Loading…
Reference in a new issue