diff options
Diffstat (limited to 'crates/ra_syntax/test_data/parser')
7 files changed, 61 insertions, 136 deletions
diff --git a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.txt b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.txt index ee0ac52c3..310a82464 100644 --- a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.txt +++ b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.txt | |||
@@ -12,8 +12,8 @@ SOURCE_FILE@[0; 112) | |||
12 | BLOCK@[7; 33) | 12 | BLOCK@[7; 33) |
13 | L_CURLY@[7; 8) "{" | 13 | L_CURLY@[7; 8) "{" |
14 | WHITESPACE@[8; 9) " " | 14 | WHITESPACE@[8; 9) " " |
15 | EXPR_STMT@[9; 15) | 15 | EXPR_STMT@[9; 26) |
16 | ARRAY_EXPR@[9; 15) | 16 | ARRAY_EXPR@[9; 26) |
17 | L_BRACK@[9; 10) "[" | 17 | L_BRACK@[9; 10) "[" |
18 | LITERAL@[10; 11) | 18 | LITERAL@[10; 11) |
19 | INT_NUMBER@[10; 11) "1" | 19 | INT_NUMBER@[10; 11) "1" |
@@ -22,17 +22,13 @@ SOURCE_FILE@[0; 112) | |||
22 | LITERAL@[13; 14) | 22 | LITERAL@[13; 14) |
23 | INT_NUMBER@[13; 14) "2" | 23 | INT_NUMBER@[13; 14) "2" |
24 | COMMA@[14; 15) "," | 24 | COMMA@[14; 15) "," |
25 | WHITESPACE@[15; 16) " " | 25 | WHITESPACE@[15; 16) " " |
26 | EXPR_STMT@[16; 17) | 26 | ERROR@[16; 17) |
27 | ERROR@[16; 17) | 27 | AT@[16; 17) "@" |
28 | AT@[16; 17) "@" | ||
29 | EXPR_STMT@[17; 18) | ||
30 | ERROR@[17; 18) | ||
31 | COMMA@[17; 18) "," | 28 | COMMA@[17; 18) "," |
32 | WHITESPACE@[18; 19) " " | 29 | WHITESPACE@[18; 19) " " |
33 | STRUCT_DEF@[19; 26) | 30 | ERROR@[19; 25) |
34 | STRUCT_KW@[19; 25) "struct" | 31 | STRUCT_KW@[19; 25) "struct" |
35 | ERROR@[25; 26) | ||
36 | COMMA@[25; 26) "," | 32 | COMMA@[25; 26) "," |
37 | WHITESPACE@[26; 27) " " | 33 | WHITESPACE@[26; 27) " " |
38 | LET_STMT@[27; 31) | 34 | LET_STMT@[27; 31) |
@@ -151,15 +147,12 @@ SOURCE_FILE@[0; 112) | |||
151 | WHITESPACE@[109; 110) " " | 147 | WHITESPACE@[109; 110) " " |
152 | R_CURLY@[110; 111) "}" | 148 | R_CURLY@[110; 111) "}" |
153 | WHITESPACE@[111; 112) "\n" | 149 | WHITESPACE@[111; 112) "\n" |
154 | error 15: expected expression | ||
155 | error 15: expected R_BRACK | ||
156 | error 15: expected SEMI | ||
157 | error 16: expected expression | 150 | error 16: expected expression |
158 | error 17: expected SEMI | 151 | error 19: expected expression |
159 | error 17: expected expression | 152 | error 26: expected expression |
160 | error 18: expected SEMI | 153 | error 26: expected COMMA |
161 | error 25: expected a name | 154 | error 26: expected R_BRACK |
162 | error 26: expected `;`, `{`, or `(` | 155 | error 26: expected SEMI |
163 | error 30: expected pattern | 156 | error 30: expected pattern |
164 | error 31: expected SEMI | 157 | error 31: expected SEMI |
165 | error 52: expected expression | 158 | error 52: expected expression |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs b/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs deleted file mode 100644 index f59e13771..000000000 --- a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | pub const A: &[i64] = &[ | ||
2 | #[cfg(test)] | ||
3 | 1, | ||
4 | 2, | ||
5 | ]; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt deleted file mode 100644 index 8f2e91bdf..000000000 --- a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | SOURCE_FILE@[0; 56) | ||
2 | CONST_DEF@[0; 55) | ||
3 | VISIBILITY@[0; 3) | ||
4 | PUB_KW@[0; 3) "pub" | ||
5 | WHITESPACE@[3; 4) " " | ||
6 | CONST_KW@[4; 9) "const" | ||
7 | WHITESPACE@[9; 10) " " | ||
8 | NAME@[10; 11) | ||
9 | IDENT@[10; 11) "A" | ||
10 | COLON@[11; 12) ":" | ||
11 | WHITESPACE@[12; 13) " " | ||
12 | REFERENCE_TYPE@[13; 19) | ||
13 | AMP@[13; 14) "&" | ||
14 | SLICE_TYPE@[14; 19) | ||
15 | L_BRACK@[14; 15) "[" | ||
16 | PATH_TYPE@[15; 18) | ||
17 | PATH@[15; 18) | ||
18 | PATH_SEGMENT@[15; 18) | ||
19 | NAME_REF@[15; 18) | ||
20 | IDENT@[15; 18) "i64" | ||
21 | R_BRACK@[18; 19) "]" | ||
22 | WHITESPACE@[19; 20) " " | ||
23 | EQ@[20; 21) "=" | ||
24 | WHITESPACE@[21; 22) " " | ||
25 | REF_EXPR@[22; 54) | ||
26 | AMP@[22; 23) "&" | ||
27 | ARRAY_EXPR@[23; 54) | ||
28 | L_BRACK@[23; 24) "[" | ||
29 | WHITESPACE@[24; 28) "\n " | ||
30 | ATTR@[28; 40) | ||
31 | POUND@[28; 29) "#" | ||
32 | L_BRACK@[29; 30) "[" | ||
33 | PATH@[30; 33) | ||
34 | PATH_SEGMENT@[30; 33) | ||
35 | NAME_REF@[30; 33) | ||
36 | IDENT@[30; 33) "cfg" | ||
37 | TOKEN_TREE@[33; 39) | ||
38 | L_PAREN@[33; 34) "(" | ||
39 | IDENT@[34; 38) "test" | ||
40 | R_PAREN@[38; 39) ")" | ||
41 | R_BRACK@[39; 40) "]" | ||
42 | WHITESPACE@[40; 44) "\n " | ||
43 | LITERAL@[44; 45) | ||
44 | INT_NUMBER@[44; 45) "1" | ||
45 | COMMA@[45; 46) "," | ||
46 | WHITESPACE@[46; 50) "\n " | ||
47 | LITERAL@[50; 51) | ||
48 | INT_NUMBER@[50; 51) "2" | ||
49 | COMMA@[51; 52) "," | ||
50 | WHITESPACE@[52; 53) "\n" | ||
51 | R_BRACK@[53; 54) "]" | ||
52 | SEMI@[54; 55) ";" | ||
53 | WHITESPACE@[55; 56) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs b/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs deleted file mode 100644 index 1324acb3f..000000000 --- a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | pub const A: &[i64] = &[ | ||
2 | 1, | ||
3 | #[cfg(test)] | ||
4 | 2, | ||
5 | ]; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt deleted file mode 100644 index 41914eb8e..000000000 --- a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | SOURCE_FILE@[0; 56) | ||
2 | CONST_DEF@[0; 55) | ||
3 | VISIBILITY@[0; 3) | ||
4 | PUB_KW@[0; 3) "pub" | ||
5 | WHITESPACE@[3; 4) " " | ||
6 | CONST_KW@[4; 9) "const" | ||
7 | WHITESPACE@[9; 10) " " | ||
8 | NAME@[10; 11) | ||
9 | IDENT@[10; 11) "A" | ||
10 | COLON@[11; 12) ":" | ||
11 | WHITESPACE@[12; 13) " " | ||
12 | REFERENCE_TYPE@[13; 19) | ||
13 | AMP@[13; 14) "&" | ||
14 | SLICE_TYPE@[14; 19) | ||
15 | L_BRACK@[14; 15) "[" | ||
16 | PATH_TYPE@[15; 18) | ||
17 | PATH@[15; 18) | ||
18 | PATH_SEGMENT@[15; 18) | ||
19 | NAME_REF@[15; 18) | ||
20 | IDENT@[15; 18) "i64" | ||
21 | R_BRACK@[18; 19) "]" | ||
22 | WHITESPACE@[19; 20) " " | ||
23 | EQ@[20; 21) "=" | ||
24 | WHITESPACE@[21; 22) " " | ||
25 | REF_EXPR@[22; 54) | ||
26 | AMP@[22; 23) "&" | ||
27 | ARRAY_EXPR@[23; 54) | ||
28 | L_BRACK@[23; 24) "[" | ||
29 | WHITESPACE@[24; 28) "\n " | ||
30 | LITERAL@[28; 29) | ||
31 | INT_NUMBER@[28; 29) "1" | ||
32 | COMMA@[29; 30) "," | ||
33 | WHITESPACE@[30; 34) "\n " | ||
34 | ATTR@[34; 46) | ||
35 | POUND@[34; 35) "#" | ||
36 | L_BRACK@[35; 36) "[" | ||
37 | PATH@[36; 39) | ||
38 | PATH_SEGMENT@[36; 39) | ||
39 | NAME_REF@[36; 39) | ||
40 | IDENT@[36; 39) "cfg" | ||
41 | TOKEN_TREE@[39; 45) | ||
42 | L_PAREN@[39; 40) "(" | ||
43 | IDENT@[40; 44) "test" | ||
44 | R_PAREN@[44; 45) ")" | ||
45 | R_BRACK@[45; 46) "]" | ||
46 | WHITESPACE@[46; 50) "\n " | ||
47 | LITERAL@[50; 51) | ||
48 | INT_NUMBER@[50; 51) "2" | ||
49 | COMMA@[51; 52) "," | ||
50 | WHITESPACE@[52; 53) "\n" | ||
51 | R_BRACK@[53; 54) "]" | ||
52 | SEMI@[54; 55) ";" | ||
53 | WHITESPACE@[55; 56) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rs b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rs new file mode 100644 index 000000000..2ac310924 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rs | |||
@@ -0,0 +1 @@ | |||
const A: &[i64] = &[1, #[cfg(test)] 2]; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.txt b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.txt new file mode 100644 index 000000000..78e296f88 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.txt | |||
@@ -0,0 +1,47 @@ | |||
1 | SOURCE_FILE@[0; 40) | ||
2 | CONST_DEF@[0; 39) | ||
3 | CONST_KW@[0; 5) "const" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "A" | ||
7 | COLON@[7; 8) ":" | ||
8 | WHITESPACE@[8; 9) " " | ||
9 | REFERENCE_TYPE@[9; 15) | ||
10 | AMP@[9; 10) "&" | ||
11 | SLICE_TYPE@[10; 15) | ||
12 | L_BRACK@[10; 11) "[" | ||
13 | PATH_TYPE@[11; 14) | ||
14 | PATH@[11; 14) | ||
15 | PATH_SEGMENT@[11; 14) | ||
16 | NAME_REF@[11; 14) | ||
17 | IDENT@[11; 14) "i64" | ||
18 | R_BRACK@[14; 15) "]" | ||
19 | WHITESPACE@[15; 16) " " | ||
20 | EQ@[16; 17) "=" | ||
21 | WHITESPACE@[17; 18) " " | ||
22 | REF_EXPR@[18; 38) | ||
23 | AMP@[18; 19) "&" | ||
24 | ARRAY_EXPR@[19; 38) | ||
25 | L_BRACK@[19; 20) "[" | ||
26 | LITERAL@[20; 21) | ||
27 | INT_NUMBER@[20; 21) "1" | ||
28 | COMMA@[21; 22) "," | ||
29 | WHITESPACE@[22; 23) " " | ||
30 | LITERAL@[23; 37) | ||
31 | ATTR@[23; 35) | ||
32 | POUND@[23; 24) "#" | ||
33 | L_BRACK@[24; 25) "[" | ||
34 | PATH@[25; 28) | ||
35 | PATH_SEGMENT@[25; 28) | ||
36 | NAME_REF@[25; 28) | ||
37 | IDENT@[25; 28) "cfg" | ||
38 | TOKEN_TREE@[28; 34) | ||
39 | L_PAREN@[28; 29) "(" | ||
40 | IDENT@[29; 33) "test" | ||
41 | R_PAREN@[33; 34) ")" | ||
42 | R_BRACK@[34; 35) "]" | ||
43 | WHITESPACE@[35; 36) " " | ||
44 | INT_NUMBER@[36; 37) "2" | ||
45 | R_BRACK@[37; 38) "]" | ||
46 | SEMI@[38; 39) ";" | ||
47 | WHITESPACE@[39; 40) "\n" | ||