diff options
Diffstat (limited to 'crates/ra_syntax/tests/data/parser/err')
-rw-r--r-- | crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.rs | 15 | ||||
-rw-r--r-- | crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt | 114 |
2 files changed, 129 insertions, 0 deletions
diff --git a/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.rs b/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.rs new file mode 100644 index 000000000..6a04f2d0a --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.rs | |||
@@ -0,0 +1,15 @@ | |||
1 | fn block() { | ||
2 | let inner = { | ||
3 | #![doc("Inner attributes not allowed here")] | ||
4 | //! Nor are ModuleDoc comments | ||
5 | }; | ||
6 | if true { | ||
7 | #![doc("Nor here")] | ||
8 | #![doc("We error on each attr")] | ||
9 | //! Nor are ModuleDoc comments | ||
10 | } | ||
11 | while true { | ||
12 | #![doc("Nor here")] | ||
13 | //! Nor are ModuleDoc comments | ||
14 | } | ||
15 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt b/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt new file mode 100644 index 000000000..086aa79ac --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt | |||
@@ -0,0 +1,114 @@ | |||
1 | SOURCE_FILE@[0; 350) | ||
2 | FN_DEF@[0; 349) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 8) | ||
6 | IDENT@[3; 8) "block" | ||
7 | PARAM_LIST@[8; 10) | ||
8 | L_PAREN@[8; 9) | ||
9 | R_PAREN@[9; 10) | ||
10 | WHITESPACE@[10; 11) | ||
11 | BLOCK@[11; 349) | ||
12 | L_CURLY@[11; 12) | ||
13 | WHITESPACE@[12; 17) | ||
14 | LET_STMT@[17; 129) | ||
15 | LET_KW@[17; 20) | ||
16 | WHITESPACE@[20; 21) | ||
17 | BIND_PAT@[21; 26) | ||
18 | NAME@[21; 26) | ||
19 | IDENT@[21; 26) "inner" | ||
20 | WHITESPACE@[26; 27) | ||
21 | EQ@[27; 28) | ||
22 | WHITESPACE@[28; 29) | ||
23 | BLOCK_EXPR@[29; 128) | ||
24 | BLOCK@[29; 128) | ||
25 | L_CURLY@[29; 30) | ||
26 | WHITESPACE@[30; 39) | ||
27 | err: `A block in this position cannot accept inner attributes` | ||
28 | ATTR@[39; 83) | ||
29 | POUND@[39; 40) | ||
30 | EXCL@[40; 41) | ||
31 | TOKEN_TREE@[41; 83) | ||
32 | L_BRACK@[41; 42) | ||
33 | IDENT@[42; 45) "doc" | ||
34 | TOKEN_TREE@[45; 82) | ||
35 | L_PAREN@[45; 46) | ||
36 | STRING@[46; 81) | ||
37 | R_PAREN@[81; 82) | ||
38 | R_BRACK@[82; 83) | ||
39 | WHITESPACE@[83; 92) | ||
40 | COMMENT@[92; 122) | ||
41 | WHITESPACE@[122; 127) | ||
42 | R_CURLY@[127; 128) | ||
43 | SEMI@[128; 129) | ||
44 | WHITESPACE@[129; 134) | ||
45 | EXPR_STMT@[134; 257) | ||
46 | IF_EXPR@[134; 257) | ||
47 | IF_KW@[134; 136) | ||
48 | WHITESPACE@[136; 137) | ||
49 | CONDITION@[137; 141) | ||
50 | LITERAL@[137; 141) | ||
51 | TRUE_KW@[137; 141) | ||
52 | WHITESPACE@[141; 142) | ||
53 | BLOCK@[142; 257) | ||
54 | L_CURLY@[142; 143) | ||
55 | WHITESPACE@[143; 152) | ||
56 | err: `A block in this position cannot accept inner attributes` | ||
57 | ATTR@[152; 171) | ||
58 | POUND@[152; 153) | ||
59 | EXCL@[153; 154) | ||
60 | TOKEN_TREE@[154; 171) | ||
61 | L_BRACK@[154; 155) | ||
62 | IDENT@[155; 158) "doc" | ||
63 | TOKEN_TREE@[158; 170) | ||
64 | L_PAREN@[158; 159) | ||
65 | STRING@[159; 169) | ||
66 | R_PAREN@[169; 170) | ||
67 | R_BRACK@[170; 171) | ||
68 | WHITESPACE@[171; 180) | ||
69 | err: `A block in this position cannot accept inner attributes` | ||
70 | ATTR@[180; 212) | ||
71 | POUND@[180; 181) | ||
72 | EXCL@[181; 182) | ||
73 | TOKEN_TREE@[182; 212) | ||
74 | L_BRACK@[182; 183) | ||
75 | IDENT@[183; 186) "doc" | ||
76 | TOKEN_TREE@[186; 211) | ||
77 | L_PAREN@[186; 187) | ||
78 | STRING@[187; 210) | ||
79 | R_PAREN@[210; 211) | ||
80 | R_BRACK@[211; 212) | ||
81 | WHITESPACE@[212; 221) | ||
82 | COMMENT@[221; 251) | ||
83 | WHITESPACE@[251; 256) | ||
84 | R_CURLY@[256; 257) | ||
85 | WHITESPACE@[257; 262) | ||
86 | WHILE_EXPR@[262; 347) | ||
87 | WHILE_KW@[262; 267) | ||
88 | WHITESPACE@[267; 268) | ||
89 | CONDITION@[268; 272) | ||
90 | LITERAL@[268; 272) | ||
91 | TRUE_KW@[268; 272) | ||
92 | WHITESPACE@[272; 273) | ||
93 | BLOCK@[273; 347) | ||
94 | L_CURLY@[273; 274) | ||
95 | WHITESPACE@[274; 283) | ||
96 | err: `A block in this position cannot accept inner attributes` | ||
97 | ATTR@[283; 302) | ||
98 | POUND@[283; 284) | ||
99 | EXCL@[284; 285) | ||
100 | TOKEN_TREE@[285; 302) | ||
101 | L_BRACK@[285; 286) | ||
102 | IDENT@[286; 289) "doc" | ||
103 | TOKEN_TREE@[289; 301) | ||
104 | L_PAREN@[289; 290) | ||
105 | STRING@[290; 300) | ||
106 | R_PAREN@[300; 301) | ||
107 | R_BRACK@[301; 302) | ||
108 | WHITESPACE@[302; 311) | ||
109 | COMMENT@[311; 341) | ||
110 | WHITESPACE@[341; 346) | ||
111 | R_CURLY@[346; 347) | ||
112 | WHITESPACE@[347; 348) | ||
113 | R_CURLY@[348; 349) | ||
114 | WHITESPACE@[349; 350) | ||