Add tests for parser recovery in fields
This commit is contained in:
parent
3630aeb1ea
commit
357cd33581
2 changed files with 61 additions and 0 deletions
7
tests/data/parser/err/0006_named_field_recovery.rs
Normal file
7
tests/data/parser/err/0006_named_field_recovery.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
struct S {
|
||||
f: u32,
|
||||
pub 92
|
||||
+ - *
|
||||
pub x: u32,
|
||||
z: f64,
|
||||
}
|
54
tests/data/parser/err/0006_named_field_recovery.txt
Normal file
54
tests/data/parser/err/0006_named_field_recovery.txt
Normal file
|
@ -0,0 +1,54 @@
|
|||
FILE@[0; 74)
|
||||
STRUCT_ITEM@[0; 74)
|
||||
STRUCT_KW@[0; 6)
|
||||
WHITESPACE@[6; 7)
|
||||
IDENT@[7; 8)
|
||||
WHITESPACE@[8; 9)
|
||||
L_CURLY@[9; 10)
|
||||
NAMED_FIELD@[10; 21)
|
||||
WHITESPACE@[10; 15)
|
||||
IDENT@[15; 16)
|
||||
COLON@[16; 17)
|
||||
WHITESPACE@[17; 18)
|
||||
IDENT@[18; 21)
|
||||
COMMA@[21; 22)
|
||||
VISIBILITY@[22; 31)
|
||||
WHITESPACE@[22; 27)
|
||||
PUB_KW@[27; 30)
|
||||
WHITESPACE@[30; 31)
|
||||
err: `expected IDENT`
|
||||
ERROR@[31; 38)
|
||||
err: `expected field declaration`
|
||||
INT_NUMBER@[31; 33)
|
||||
WHITESPACE@[33; 38)
|
||||
ERROR@[38; 40)
|
||||
err: `expected field declaration`
|
||||
PLUS@[38; 39)
|
||||
WHITESPACE@[39; 40)
|
||||
ERROR@[40; 42)
|
||||
err: `expected field declaration`
|
||||
MINUS@[40; 41)
|
||||
WHITESPACE@[41; 42)
|
||||
ERROR@[42; 48)
|
||||
err: `expected field declaration`
|
||||
STAR@[42; 43)
|
||||
WHITESPACE@[43; 48)
|
||||
NAMED_FIELD@[48; 58)
|
||||
VISIBILITY@[48; 52)
|
||||
PUB_KW@[48; 51)
|
||||
WHITESPACE@[51; 52)
|
||||
IDENT@[52; 53)
|
||||
COLON@[53; 54)
|
||||
WHITESPACE@[54; 55)
|
||||
IDENT@[55; 58)
|
||||
COMMA@[58; 59)
|
||||
NAMED_FIELD@[59; 70)
|
||||
WHITESPACE@[59; 64)
|
||||
IDENT@[64; 65)
|
||||
COLON@[65; 66)
|
||||
WHITESPACE@[66; 67)
|
||||
IDENT@[67; 70)
|
||||
COMMA@[70; 71)
|
||||
WHITESPACE@[71; 72)
|
||||
R_CURLY@[72; 73)
|
||||
WHITESPACE@[73; 74)
|
Loading…
Add table
Reference in a new issue