mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 01:17:27 +00:00
Test attribute recovery
This commit is contained in:
parent
efd538d793
commit
c8cf1d8cda
2 changed files with 62 additions and 0 deletions
8
tests/data/parser/err/0005_attribute_recover.rs
Normal file
8
tests/data/parser/err/0005_attribute_recover.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
#[foo(foo, +, 92)]
|
||||
fn foo() {
|
||||
}
|
||||
|
||||
|
||||
#[foo(
|
||||
fn foo() {
|
||||
}
|
54
tests/data/parser/err/0005_attribute_recover.txt
Normal file
54
tests/data/parser/err/0005_attribute_recover.txt
Normal file
|
@ -0,0 +1,54 @@
|
|||
FILE@[0; 54)
|
||||
FN_ITEM@[0; 34)
|
||||
ATTR@[0; 19)
|
||||
POUND@[0; 1)
|
||||
L_BRACK@[1; 2)
|
||||
META_ITEM@[2; 17)
|
||||
IDENT@[2; 5)
|
||||
L_PAREN@[5; 6)
|
||||
META_ITEM@[6; 9)
|
||||
IDENT@[6; 9)
|
||||
COMMA@[9; 10)
|
||||
ERROR@[10; 12)
|
||||
err: `expected attribute`
|
||||
WHITESPACE@[10; 11)
|
||||
PLUS@[11; 12)
|
||||
ERROR@[12; 14)
|
||||
err: `expected attribute`
|
||||
COMMA@[12; 13)
|
||||
WHITESPACE@[13; 14)
|
||||
LITERAL@[14; 16)
|
||||
INT_NUMBER@[14; 16)
|
||||
R_PAREN@[16; 17)
|
||||
R_BRACK@[17; 18)
|
||||
WHITESPACE@[18; 19)
|
||||
FN_KW@[19; 21)
|
||||
WHITESPACE@[21; 22)
|
||||
IDENT@[22; 25)
|
||||
L_PAREN@[25; 26)
|
||||
R_PAREN@[26; 27)
|
||||
WHITESPACE@[27; 28)
|
||||
L_CURLY@[28; 29)
|
||||
WHITESPACE@[29; 30)
|
||||
R_CURLY@[30; 31)
|
||||
WHITESPACE@[31; 34)
|
||||
FN_ITEM@[34; 54)
|
||||
ATTR@[34; 41)
|
||||
POUND@[34; 35)
|
||||
L_BRACK@[35; 36)
|
||||
META_ITEM@[36; 41)
|
||||
IDENT@[36; 39)
|
||||
L_PAREN@[39; 40)
|
||||
err: `expected attribute`
|
||||
WHITESPACE@[40; 41)
|
||||
err: `expected R_BRACK`
|
||||
FN_KW@[41; 43)
|
||||
WHITESPACE@[43; 44)
|
||||
IDENT@[44; 47)
|
||||
L_PAREN@[47; 48)
|
||||
R_PAREN@[48; 49)
|
||||
WHITESPACE@[49; 50)
|
||||
L_CURLY@[50; 51)
|
||||
WHITESPACE@[51; 52)
|
||||
R_CURLY@[52; 53)
|
||||
WHITESPACE@[53; 54)
|
Loading…
Reference in a new issue