diff options
author | Aleksey Kladov <[email protected]> | 2018-08-10 20:33:29 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-10 20:33:29 +0100 |
commit | 7c67612b8a894187fa3b64725531a5459f9211bf (patch) | |
tree | 9e2a536efa0c880d921fd8d4d74423afc9451fd4 /crates/libsyntax2/tests/data/parser/ok | |
parent | 26262aaf05983c5b7f41cc438e287523268fe1eb (diff) |
organizize
Diffstat (limited to 'crates/libsyntax2/tests/data/parser/ok')
58 files changed, 2151 insertions, 0 deletions
diff --git a/crates/libsyntax2/tests/data/parser/ok/0000_empty.rs b/crates/libsyntax2/tests/data/parser/ok/0000_empty.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0000_empty.rs | |||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0000_empty.txt b/crates/libsyntax2/tests/data/parser/ok/0000_empty.txt new file mode 100644 index 000000000..54be3e7bc --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0000_empty.txt | |||
@@ -0,0 +1 @@ | |||
FILE@[0; 0) | |||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.rs b/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.rs new file mode 100644 index 000000000..d3a8c1d23 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | struct S { | ||
2 | |||
3 | } \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.txt b/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.txt new file mode 100644 index 000000000..3d5b5cb7f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | FILE@[0; 13) | ||
2 | STRUCT_ITEM@[0; 13) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | WHITESPACE@[8; 9) | ||
8 | L_CURLY@[9; 10) | ||
9 | WHITESPACE@[10; 12) | ||
10 | R_CURLY@[12; 13) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.rs b/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.rs new file mode 100644 index 000000000..cc3866d25 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | struct S { | ||
2 | foo: u32 | ||
3 | } \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.txt b/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.txt new file mode 100644 index 000000000..1129ce39e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | FILE@[0; 25) | ||
2 | STRUCT_ITEM@[0; 25) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | WHITESPACE@[8; 9) | ||
8 | L_CURLY@[9; 10) | ||
9 | WHITESPACE@[10; 15) | ||
10 | NAMED_FIELD@[15; 23) | ||
11 | NAME@[15; 18) | ||
12 | IDENT@[15; 18) "foo" | ||
13 | COLON@[18; 19) | ||
14 | WHITESPACE@[19; 20) | ||
15 | PATH_TYPE@[20; 23) | ||
16 | PATH@[20; 23) | ||
17 | PATH_SEGMENT@[20; 23) | ||
18 | NAME_REF@[20; 23) | ||
19 | IDENT@[20; 23) "u32" | ||
20 | WHITESPACE@[23; 24) | ||
21 | R_CURLY@[24; 25) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.rs b/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.rs new file mode 100644 index 000000000..53dc9e617 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.rs | |||
@@ -0,0 +1 @@ | |||
#!/use/bin/env rusti \ No newline at end of file | |||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.txt b/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.txt new file mode 100644 index 000000000..33055cf3d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.txt | |||
@@ -0,0 +1,2 @@ | |||
1 | FILE@[0; 20) | ||
2 | SHEBANG@[0; 20) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.rs b/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.rs new file mode 100644 index 000000000..03210551c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | fn foo() { | ||
2 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.txt b/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.txt new file mode 100644 index 000000000..4ab93d408 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | FILE@[0; 13) | ||
2 | FUNCTION@[0; 12) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 12) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | R_CURLY@[11; 12) | ||
15 | WHITESPACE@[12; 13) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.rs b/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.rs new file mode 100644 index 000000000..e81f8b1e8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.rs | |||
@@ -0,0 +1,10 @@ | |||
1 | #![attr] | ||
2 | #![attr(true)] | ||
3 | #![attr(ident)] | ||
4 | #![attr(ident, 100, true, "true", ident = 100, ident = "hello", ident(100))] | ||
5 | #![attr(100)] | ||
6 | #![attr(enabled = true)] | ||
7 | #![enabled(true)] | ||
8 | #![attr("hello")] | ||
9 | #![repr(C, align = 4)] | ||
10 | #![repr(C, align(4))] \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.txt b/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.txt new file mode 100644 index 000000000..562c8d917 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.txt | |||
@@ -0,0 +1,176 @@ | |||
1 | FILE@[0; 236) | ||
2 | ATTR@[0; 8) | ||
3 | POUND@[0; 1) | ||
4 | EXCL@[1; 2) | ||
5 | L_BRACK@[2; 3) | ||
6 | META_ITEM@[3; 7) | ||
7 | IDENT@[3; 7) "attr" | ||
8 | R_BRACK@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | ATTR@[9; 23) | ||
11 | POUND@[9; 10) | ||
12 | EXCL@[10; 11) | ||
13 | L_BRACK@[11; 12) | ||
14 | META_ITEM@[12; 22) | ||
15 | IDENT@[12; 16) "attr" | ||
16 | L_PAREN@[16; 17) | ||
17 | LITERAL@[17; 21) | ||
18 | TRUE_KW@[17; 21) | ||
19 | R_PAREN@[21; 22) | ||
20 | R_BRACK@[22; 23) | ||
21 | WHITESPACE@[23; 24) | ||
22 | ATTR@[24; 39) | ||
23 | POUND@[24; 25) | ||
24 | EXCL@[25; 26) | ||
25 | L_BRACK@[26; 27) | ||
26 | META_ITEM@[27; 38) | ||
27 | IDENT@[27; 31) "attr" | ||
28 | L_PAREN@[31; 32) | ||
29 | META_ITEM@[32; 37) | ||
30 | IDENT@[32; 37) "ident" | ||
31 | R_PAREN@[37; 38) | ||
32 | R_BRACK@[38; 39) | ||
33 | WHITESPACE@[39; 40) | ||
34 | ATTR@[40; 116) | ||
35 | POUND@[40; 41) | ||
36 | EXCL@[41; 42) | ||
37 | L_BRACK@[42; 43) | ||
38 | META_ITEM@[43; 115) | ||
39 | IDENT@[43; 47) "attr" | ||
40 | L_PAREN@[47; 48) | ||
41 | META_ITEM@[48; 53) | ||
42 | IDENT@[48; 53) "ident" | ||
43 | COMMA@[53; 54) | ||
44 | WHITESPACE@[54; 55) | ||
45 | LITERAL@[55; 58) | ||
46 | INT_NUMBER@[55; 58) "100" | ||
47 | COMMA@[58; 59) | ||
48 | WHITESPACE@[59; 60) | ||
49 | LITERAL@[60; 64) | ||
50 | TRUE_KW@[60; 64) | ||
51 | COMMA@[64; 65) | ||
52 | WHITESPACE@[65; 66) | ||
53 | LITERAL@[66; 72) | ||
54 | STRING@[66; 72) | ||
55 | COMMA@[72; 73) | ||
56 | WHITESPACE@[73; 74) | ||
57 | META_ITEM@[74; 85) | ||
58 | IDENT@[74; 79) "ident" | ||
59 | WHITESPACE@[79; 80) | ||
60 | EQ@[80; 81) | ||
61 | WHITESPACE@[81; 82) | ||
62 | LITERAL@[82; 85) | ||
63 | INT_NUMBER@[82; 85) "100" | ||
64 | COMMA@[85; 86) | ||
65 | WHITESPACE@[86; 87) | ||
66 | META_ITEM@[87; 102) | ||
67 | IDENT@[87; 92) "ident" | ||
68 | WHITESPACE@[92; 93) | ||
69 | EQ@[93; 94) | ||
70 | WHITESPACE@[94; 95) | ||
71 | LITERAL@[95; 102) | ||
72 | STRING@[95; 102) | ||
73 | COMMA@[102; 103) | ||
74 | WHITESPACE@[103; 104) | ||
75 | META_ITEM@[104; 114) | ||
76 | IDENT@[104; 109) "ident" | ||
77 | L_PAREN@[109; 110) | ||
78 | LITERAL@[110; 113) | ||
79 | INT_NUMBER@[110; 113) "100" | ||
80 | R_PAREN@[113; 114) | ||
81 | R_PAREN@[114; 115) | ||
82 | R_BRACK@[115; 116) | ||
83 | WHITESPACE@[116; 117) | ||
84 | ATTR@[117; 130) | ||
85 | POUND@[117; 118) | ||
86 | EXCL@[118; 119) | ||
87 | L_BRACK@[119; 120) | ||
88 | META_ITEM@[120; 129) | ||
89 | IDENT@[120; 124) "attr" | ||
90 | L_PAREN@[124; 125) | ||
91 | LITERAL@[125; 128) | ||
92 | INT_NUMBER@[125; 128) "100" | ||
93 | R_PAREN@[128; 129) | ||
94 | R_BRACK@[129; 130) | ||
95 | WHITESPACE@[130; 131) | ||
96 | ATTR@[131; 155) | ||
97 | POUND@[131; 132) | ||
98 | EXCL@[132; 133) | ||
99 | L_BRACK@[133; 134) | ||
100 | META_ITEM@[134; 154) | ||
101 | IDENT@[134; 138) "attr" | ||
102 | L_PAREN@[138; 139) | ||
103 | META_ITEM@[139; 153) | ||
104 | IDENT@[139; 146) "enabled" | ||
105 | WHITESPACE@[146; 147) | ||
106 | EQ@[147; 148) | ||
107 | WHITESPACE@[148; 149) | ||
108 | LITERAL@[149; 153) | ||
109 | TRUE_KW@[149; 153) | ||
110 | R_PAREN@[153; 154) | ||
111 | R_BRACK@[154; 155) | ||
112 | WHITESPACE@[155; 156) | ||
113 | ATTR@[156; 173) | ||
114 | POUND@[156; 157) | ||
115 | EXCL@[157; 158) | ||
116 | L_BRACK@[158; 159) | ||
117 | META_ITEM@[159; 172) | ||
118 | IDENT@[159; 166) "enabled" | ||
119 | L_PAREN@[166; 167) | ||
120 | LITERAL@[167; 171) | ||
121 | TRUE_KW@[167; 171) | ||
122 | R_PAREN@[171; 172) | ||
123 | R_BRACK@[172; 173) | ||
124 | WHITESPACE@[173; 174) | ||
125 | ATTR@[174; 191) | ||
126 | POUND@[174; 175) | ||
127 | EXCL@[175; 176) | ||
128 | L_BRACK@[176; 177) | ||
129 | META_ITEM@[177; 190) | ||
130 | IDENT@[177; 181) "attr" | ||
131 | L_PAREN@[181; 182) | ||
132 | LITERAL@[182; 189) | ||
133 | STRING@[182; 189) | ||
134 | R_PAREN@[189; 190) | ||
135 | R_BRACK@[190; 191) | ||
136 | WHITESPACE@[191; 192) | ||
137 | ATTR@[192; 214) | ||
138 | POUND@[192; 193) | ||
139 | EXCL@[193; 194) | ||
140 | L_BRACK@[194; 195) | ||
141 | META_ITEM@[195; 213) | ||
142 | IDENT@[195; 199) "repr" | ||
143 | L_PAREN@[199; 200) | ||
144 | META_ITEM@[200; 201) | ||
145 | IDENT@[200; 201) "C" | ||
146 | COMMA@[201; 202) | ||
147 | WHITESPACE@[202; 203) | ||
148 | META_ITEM@[203; 212) | ||
149 | IDENT@[203; 208) "align" | ||
150 | WHITESPACE@[208; 209) | ||
151 | EQ@[209; 210) | ||
152 | WHITESPACE@[210; 211) | ||
153 | LITERAL@[211; 212) | ||
154 | INT_NUMBER@[211; 212) "4" | ||
155 | R_PAREN@[212; 213) | ||
156 | R_BRACK@[213; 214) | ||
157 | WHITESPACE@[214; 215) | ||
158 | ATTR@[215; 236) | ||
159 | POUND@[215; 216) | ||
160 | EXCL@[216; 217) | ||
161 | L_BRACK@[217; 218) | ||
162 | META_ITEM@[218; 235) | ||
163 | IDENT@[218; 222) "repr" | ||
164 | L_PAREN@[222; 223) | ||
165 | META_ITEM@[223; 224) | ||
166 | IDENT@[223; 224) "C" | ||
167 | COMMA@[224; 225) | ||
168 | WHITESPACE@[225; 226) | ||
169 | META_ITEM@[226; 234) | ||
170 | IDENT@[226; 231) "align" | ||
171 | L_PAREN@[231; 232) | ||
172 | LITERAL@[232; 233) | ||
173 | INT_NUMBER@[232; 233) "4" | ||
174 | R_PAREN@[233; 234) | ||
175 | R_PAREN@[234; 235) | ||
176 | R_BRACK@[235; 236) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.rs b/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.rs new file mode 100644 index 000000000..3ce336676 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | extern crate foo; | ||
2 | extern crate foo as bar; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.txt b/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.txt new file mode 100644 index 000000000..533af33c4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | FILE@[0; 43) | ||
2 | EXTERN_CRATE_ITEM@[0; 17) | ||
3 | EXTERN_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | CRATE_KW@[7; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | NAME@[13; 16) | ||
8 | IDENT@[13; 16) "foo" | ||
9 | SEMI@[16; 17) | ||
10 | WHITESPACE@[17; 18) | ||
11 | EXTERN_CRATE_ITEM@[18; 42) | ||
12 | EXTERN_KW@[18; 24) | ||
13 | WHITESPACE@[24; 25) | ||
14 | CRATE_KW@[25; 30) | ||
15 | WHITESPACE@[30; 31) | ||
16 | NAME@[31; 34) | ||
17 | IDENT@[31; 34) "foo" | ||
18 | WHITESPACE@[34; 35) | ||
19 | ALIAS@[35; 41) | ||
20 | AS_KW@[35; 37) | ||
21 | WHITESPACE@[37; 38) | ||
22 | NAME@[38; 41) | ||
23 | IDENT@[38; 41) "bar" | ||
24 | SEMI@[41; 42) | ||
25 | WHITESPACE@[42; 43) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.rs b/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.rs new file mode 100644 index 000000000..d22993bc1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.rs | |||
@@ -0,0 +1,17 @@ | |||
1 | mod a; | ||
2 | |||
3 | mod b { | ||
4 | } | ||
5 | |||
6 | mod c { | ||
7 | fn foo() { | ||
8 | } | ||
9 | struct S {} | ||
10 | } | ||
11 | |||
12 | mod d { | ||
13 | #![attr] | ||
14 | mod e; | ||
15 | mod f { | ||
16 | } | ||
17 | } \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.txt b/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.txt new file mode 100644 index 000000000..1dcaaedce --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.txt | |||
@@ -0,0 +1,85 @@ | |||
1 | FILE@[0; 118) | ||
2 | MOD_ITEM@[0; 6) | ||
3 | MOD_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | NAME@[4; 5) | ||
6 | IDENT@[4; 5) "a" | ||
7 | SEMI@[5; 6) | ||
8 | WHITESPACE@[6; 8) | ||
9 | MOD_ITEM@[8; 17) | ||
10 | MOD_KW@[8; 11) | ||
11 | WHITESPACE@[11; 12) | ||
12 | NAME@[12; 13) | ||
13 | IDENT@[12; 13) "b" | ||
14 | WHITESPACE@[13; 14) | ||
15 | L_CURLY@[14; 15) | ||
16 | WHITESPACE@[15; 16) | ||
17 | R_CURLY@[16; 17) | ||
18 | WHITESPACE@[17; 19) | ||
19 | MOD_ITEM@[19; 65) | ||
20 | MOD_KW@[19; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | NAME@[23; 24) | ||
23 | IDENT@[23; 24) "c" | ||
24 | WHITESPACE@[24; 25) | ||
25 | L_CURLY@[25; 26) | ||
26 | WHITESPACE@[26; 31) | ||
27 | FUNCTION@[31; 47) | ||
28 | FN_KW@[31; 33) | ||
29 | WHITESPACE@[33; 34) | ||
30 | NAME@[34; 37) | ||
31 | IDENT@[34; 37) "foo" | ||
32 | PARAM_LIST@[37; 39) | ||
33 | L_PAREN@[37; 38) | ||
34 | R_PAREN@[38; 39) | ||
35 | WHITESPACE@[39; 40) | ||
36 | BLOCK_EXPR@[40; 47) | ||
37 | L_CURLY@[40; 41) | ||
38 | WHITESPACE@[41; 46) | ||
39 | R_CURLY@[46; 47) | ||
40 | WHITESPACE@[47; 52) | ||
41 | STRUCT_ITEM@[52; 63) | ||
42 | STRUCT_KW@[52; 58) | ||
43 | WHITESPACE@[58; 59) | ||
44 | NAME@[59; 60) | ||
45 | IDENT@[59; 60) "S" | ||
46 | WHITESPACE@[60; 61) | ||
47 | L_CURLY@[61; 62) | ||
48 | R_CURLY@[62; 63) | ||
49 | WHITESPACE@[63; 64) | ||
50 | R_CURLY@[64; 65) | ||
51 | WHITESPACE@[65; 67) | ||
52 | MOD_ITEM@[67; 118) | ||
53 | MOD_KW@[67; 70) | ||
54 | WHITESPACE@[70; 71) | ||
55 | NAME@[71; 72) | ||
56 | IDENT@[71; 72) "d" | ||
57 | WHITESPACE@[72; 73) | ||
58 | L_CURLY@[73; 74) | ||
59 | WHITESPACE@[74; 79) | ||
60 | ATTR@[79; 87) | ||
61 | POUND@[79; 80) | ||
62 | EXCL@[80; 81) | ||
63 | L_BRACK@[81; 82) | ||
64 | META_ITEM@[82; 86) | ||
65 | IDENT@[82; 86) "attr" | ||
66 | R_BRACK@[86; 87) | ||
67 | WHITESPACE@[87; 92) | ||
68 | MOD_ITEM@[92; 98) | ||
69 | MOD_KW@[92; 95) | ||
70 | WHITESPACE@[95; 96) | ||
71 | NAME@[96; 97) | ||
72 | IDENT@[96; 97) "e" | ||
73 | SEMI@[97; 98) | ||
74 | WHITESPACE@[98; 103) | ||
75 | MOD_ITEM@[103; 116) | ||
76 | MOD_KW@[103; 106) | ||
77 | WHITESPACE@[106; 107) | ||
78 | NAME@[107; 108) | ||
79 | IDENT@[107; 108) "f" | ||
80 | WHITESPACE@[108; 109) | ||
81 | L_CURLY@[109; 110) | ||
82 | WHITESPACE@[110; 115) | ||
83 | R_CURLY@[115; 116) | ||
84 | WHITESPACE@[116; 117) | ||
85 | R_CURLY@[117; 118) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0009_use_item.rs b/crates/libsyntax2/tests/data/parser/ok/0009_use_item.rs new file mode 100644 index 000000000..05a6aff83 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0009_use_item.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | use foo; | ||
2 | use ::bar; \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0009_use_item.txt b/crates/libsyntax2/tests/data/parser/ok/0009_use_item.txt new file mode 100644 index 000000000..8f850cd1c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0009_use_item.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | FILE@[0; 19) | ||
2 | USE_ITEM@[0; 8) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 7) | ||
6 | PATH@[4; 7) | ||
7 | PATH_SEGMENT@[4; 7) | ||
8 | NAME_REF@[4; 7) | ||
9 | IDENT@[4; 7) "foo" | ||
10 | SEMI@[7; 8) | ||
11 | WHITESPACE@[8; 9) | ||
12 | USE_ITEM@[9; 19) | ||
13 | USE_KW@[9; 12) | ||
14 | WHITESPACE@[12; 13) | ||
15 | USE_TREE@[13; 18) | ||
16 | PATH@[13; 18) | ||
17 | PATH_SEGMENT@[13; 18) | ||
18 | COLONCOLON@[13; 15) | ||
19 | NAME_REF@[15; 18) | ||
20 | IDENT@[15; 18) "bar" | ||
21 | SEMI@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.rs b/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.rs new file mode 100644 index 000000000..1e71b7a6c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | use ::foo::bar::baz; | ||
2 | use foo::bar::baz; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.txt b/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.txt new file mode 100644 index 000000000..03ec342c2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | FILE@[0; 40) | ||
2 | USE_ITEM@[0; 20) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 19) | ||
6 | PATH@[4; 19) | ||
7 | PATH@[4; 14) | ||
8 | PATH@[4; 9) | ||
9 | PATH_SEGMENT@[4; 9) | ||
10 | COLONCOLON@[4; 6) | ||
11 | NAME_REF@[6; 9) | ||
12 | IDENT@[6; 9) "foo" | ||
13 | COLONCOLON@[9; 11) | ||
14 | PATH_SEGMENT@[11; 14) | ||
15 | NAME_REF@[11; 14) | ||
16 | IDENT@[11; 14) "bar" | ||
17 | COLONCOLON@[14; 16) | ||
18 | PATH_SEGMENT@[16; 19) | ||
19 | NAME_REF@[16; 19) | ||
20 | IDENT@[16; 19) "baz" | ||
21 | SEMI@[19; 20) | ||
22 | WHITESPACE@[20; 21) | ||
23 | USE_ITEM@[21; 39) | ||
24 | USE_KW@[21; 24) | ||
25 | WHITESPACE@[24; 25) | ||
26 | USE_TREE@[25; 38) | ||
27 | PATH@[25; 38) | ||
28 | PATH@[25; 33) | ||
29 | PATH@[25; 28) | ||
30 | PATH_SEGMENT@[25; 28) | ||
31 | NAME_REF@[25; 28) | ||
32 | IDENT@[25; 28) "foo" | ||
33 | COLONCOLON@[28; 30) | ||
34 | PATH_SEGMENT@[30; 33) | ||
35 | NAME_REF@[30; 33) | ||
36 | IDENT@[30; 33) "bar" | ||
37 | COLONCOLON@[33; 35) | ||
38 | PATH_SEGMENT@[35; 38) | ||
39 | NAME_REF@[35; 38) | ||
40 | IDENT@[35; 38) "baz" | ||
41 | SEMI@[38; 39) | ||
42 | WHITESPACE@[39; 40) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.rs b/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.rs new file mode 100644 index 000000000..8b80c0d90 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | #[cfg(test)] | ||
2 | #[ignore] | ||
3 | fn foo() {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.txt b/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.txt new file mode 100644 index 000000000..9824c9083 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | FILE@[0; 35) | ||
2 | FUNCTION@[0; 34) | ||
3 | ATTR@[0; 12) | ||
4 | POUND@[0; 1) | ||
5 | L_BRACK@[1; 2) | ||
6 | META_ITEM@[2; 11) | ||
7 | IDENT@[2; 5) "cfg" | ||
8 | L_PAREN@[5; 6) | ||
9 | META_ITEM@[6; 10) | ||
10 | IDENT@[6; 10) "test" | ||
11 | R_PAREN@[10; 11) | ||
12 | R_BRACK@[11; 12) | ||
13 | WHITESPACE@[12; 13) | ||
14 | ATTR@[13; 22) | ||
15 | POUND@[13; 14) | ||
16 | L_BRACK@[14; 15) | ||
17 | META_ITEM@[15; 21) | ||
18 | IDENT@[15; 21) "ignore" | ||
19 | R_BRACK@[21; 22) | ||
20 | WHITESPACE@[22; 23) | ||
21 | FN_KW@[23; 25) | ||
22 | WHITESPACE@[25; 26) | ||
23 | NAME@[26; 29) | ||
24 | IDENT@[26; 29) "foo" | ||
25 | PARAM_LIST@[29; 31) | ||
26 | L_PAREN@[29; 30) | ||
27 | R_PAREN@[30; 31) | ||
28 | WHITESPACE@[31; 32) | ||
29 | BLOCK_EXPR@[32; 34) | ||
30 | L_CURLY@[32; 33) | ||
31 | R_CURLY@[33; 34) | ||
32 | WHITESPACE@[34; 35) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0012_visibility.rs b/crates/libsyntax2/tests/data/parser/ok/0012_visibility.rs new file mode 100644 index 000000000..75b1db121 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0012_visibility.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn a() {} | ||
2 | pub fn b() {} | ||
3 | pub(crate) fn c() {} | ||
4 | pub(super) fn d() {} | ||
5 | pub(in foo::bar::baz) fn e() {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0012_visibility.txt b/crates/libsyntax2/tests/data/parser/ok/0012_visibility.txt new file mode 100644 index 000000000..af0c59543 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0012_visibility.txt | |||
@@ -0,0 +1,102 @@ | |||
1 | FILE@[0; 98) | ||
2 | FUNCTION@[0; 9) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "a" | ||
7 | PARAM_LIST@[4; 6) | ||
8 | L_PAREN@[4; 5) | ||
9 | R_PAREN@[5; 6) | ||
10 | WHITESPACE@[6; 7) | ||
11 | BLOCK_EXPR@[7; 9) | ||
12 | L_CURLY@[7; 8) | ||
13 | R_CURLY@[8; 9) | ||
14 | WHITESPACE@[9; 10) | ||
15 | FUNCTION@[10; 23) | ||
16 | VISIBILITY@[10; 13) | ||
17 | PUB_KW@[10; 13) | ||
18 | WHITESPACE@[13; 14) | ||
19 | FN_KW@[14; 16) | ||
20 | WHITESPACE@[16; 17) | ||
21 | NAME@[17; 18) | ||
22 | IDENT@[17; 18) "b" | ||
23 | PARAM_LIST@[18; 20) | ||
24 | L_PAREN@[18; 19) | ||
25 | R_PAREN@[19; 20) | ||
26 | WHITESPACE@[20; 21) | ||
27 | BLOCK_EXPR@[21; 23) | ||
28 | L_CURLY@[21; 22) | ||
29 | R_CURLY@[22; 23) | ||
30 | WHITESPACE@[23; 24) | ||
31 | FUNCTION@[24; 44) | ||
32 | VISIBILITY@[24; 34) | ||
33 | PUB_KW@[24; 27) | ||
34 | L_PAREN@[27; 28) | ||
35 | CRATE_KW@[28; 33) | ||
36 | R_PAREN@[33; 34) | ||
37 | WHITESPACE@[34; 35) | ||
38 | FN_KW@[35; 37) | ||
39 | WHITESPACE@[37; 38) | ||
40 | NAME@[38; 39) | ||
41 | IDENT@[38; 39) "c" | ||
42 | PARAM_LIST@[39; 41) | ||
43 | L_PAREN@[39; 40) | ||
44 | R_PAREN@[40; 41) | ||
45 | WHITESPACE@[41; 42) | ||
46 | BLOCK_EXPR@[42; 44) | ||
47 | L_CURLY@[42; 43) | ||
48 | R_CURLY@[43; 44) | ||
49 | WHITESPACE@[44; 45) | ||
50 | FUNCTION@[45; 65) | ||
51 | VISIBILITY@[45; 55) | ||
52 | PUB_KW@[45; 48) | ||
53 | L_PAREN@[48; 49) | ||
54 | SUPER_KW@[49; 54) | ||
55 | R_PAREN@[54; 55) | ||
56 | WHITESPACE@[55; 56) | ||
57 | FN_KW@[56; 58) | ||
58 | WHITESPACE@[58; 59) | ||
59 | NAME@[59; 60) | ||
60 | IDENT@[59; 60) "d" | ||
61 | PARAM_LIST@[60; 62) | ||
62 | L_PAREN@[60; 61) | ||
63 | R_PAREN@[61; 62) | ||
64 | WHITESPACE@[62; 63) | ||
65 | BLOCK_EXPR@[63; 65) | ||
66 | L_CURLY@[63; 64) | ||
67 | R_CURLY@[64; 65) | ||
68 | WHITESPACE@[65; 66) | ||
69 | FUNCTION@[66; 97) | ||
70 | VISIBILITY@[66; 87) | ||
71 | PUB_KW@[66; 69) | ||
72 | L_PAREN@[69; 70) | ||
73 | IN_KW@[70; 72) | ||
74 | WHITESPACE@[72; 73) | ||
75 | PATH@[73; 86) | ||
76 | PATH@[73; 81) | ||
77 | PATH@[73; 76) | ||
78 | PATH_SEGMENT@[73; 76) | ||
79 | NAME_REF@[73; 76) | ||
80 | IDENT@[73; 76) "foo" | ||
81 | COLONCOLON@[76; 78) | ||
82 | PATH_SEGMENT@[78; 81) | ||
83 | NAME_REF@[78; 81) | ||
84 | IDENT@[78; 81) "bar" | ||
85 | COLONCOLON@[81; 83) | ||
86 | PATH_SEGMENT@[83; 86) | ||
87 | NAME_REF@[83; 86) | ||
88 | IDENT@[83; 86) "baz" | ||
89 | R_PAREN@[86; 87) | ||
90 | WHITESPACE@[87; 88) | ||
91 | FN_KW@[88; 90) | ||
92 | WHITESPACE@[90; 91) | ||
93 | NAME@[91; 92) | ||
94 | IDENT@[91; 92) "e" | ||
95 | PARAM_LIST@[92; 94) | ||
96 | L_PAREN@[92; 93) | ||
97 | R_PAREN@[93; 94) | ||
98 | WHITESPACE@[94; 95) | ||
99 | BLOCK_EXPR@[95; 97) | ||
100 | L_CURLY@[95; 96) | ||
101 | R_CURLY@[96; 97) | ||
102 | WHITESPACE@[97; 98) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.rs b/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.rs new file mode 100644 index 000000000..faf6a42c7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | use self::foo; | ||
2 | use super::super::bar; | ||
3 | use ::self::a::super::bar; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.txt b/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.txt new file mode 100644 index 000000000..5ed27ca37 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.txt | |||
@@ -0,0 +1,57 @@ | |||
1 | FILE@[0; 65) | ||
2 | USE_ITEM@[0; 14) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 13) | ||
6 | PATH@[4; 13) | ||
7 | PATH@[4; 8) | ||
8 | PATH_SEGMENT@[4; 8) | ||
9 | SELF_KW@[4; 8) | ||
10 | COLONCOLON@[8; 10) | ||
11 | PATH_SEGMENT@[10; 13) | ||
12 | NAME_REF@[10; 13) | ||
13 | IDENT@[10; 13) "foo" | ||
14 | SEMI@[13; 14) | ||
15 | WHITESPACE@[14; 15) | ||
16 | USE_ITEM@[15; 37) | ||
17 | USE_KW@[15; 18) | ||
18 | WHITESPACE@[18; 19) | ||
19 | USE_TREE@[19; 36) | ||
20 | PATH@[19; 36) | ||
21 | PATH@[19; 31) | ||
22 | PATH@[19; 24) | ||
23 | PATH_SEGMENT@[19; 24) | ||
24 | SUPER_KW@[19; 24) | ||
25 | COLONCOLON@[24; 26) | ||
26 | PATH_SEGMENT@[26; 31) | ||
27 | SUPER_KW@[26; 31) | ||
28 | COLONCOLON@[31; 33) | ||
29 | PATH_SEGMENT@[33; 36) | ||
30 | NAME_REF@[33; 36) | ||
31 | IDENT@[33; 36) "bar" | ||
32 | SEMI@[36; 37) | ||
33 | WHITESPACE@[37; 38) | ||
34 | USE_ITEM@[38; 64) | ||
35 | USE_KW@[38; 41) | ||
36 | WHITESPACE@[41; 42) | ||
37 | USE_TREE@[42; 63) | ||
38 | PATH@[42; 63) | ||
39 | PATH@[42; 58) | ||
40 | PATH@[42; 51) | ||
41 | PATH@[42; 48) | ||
42 | PATH_SEGMENT@[42; 48) | ||
43 | COLONCOLON@[42; 44) | ||
44 | SELF_KW@[44; 48) | ||
45 | COLONCOLON@[48; 50) | ||
46 | PATH_SEGMENT@[50; 51) | ||
47 | NAME_REF@[50; 51) | ||
48 | IDENT@[50; 51) "a" | ||
49 | COLONCOLON@[51; 53) | ||
50 | PATH_SEGMENT@[53; 58) | ||
51 | SUPER_KW@[53; 58) | ||
52 | COLONCOLON@[58; 60) | ||
53 | PATH_SEGMENT@[60; 63) | ||
54 | NAME_REF@[60; 63) | ||
55 | IDENT@[60; 63) "bar" | ||
56 | SEMI@[63; 64) | ||
57 | WHITESPACE@[64; 65) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.rs b/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.rs new file mode 100644 index 000000000..5e4aa3a33 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | use *; | ||
2 | use ::*; | ||
3 | use ::{}; | ||
4 | use {}; | ||
5 | use foo::*; | ||
6 | use foo::{}; | ||
7 | use ::foo::{a, b, c}; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.txt b/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.txt new file mode 100644 index 000000000..730d5539b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.txt | |||
@@ -0,0 +1,91 @@ | |||
1 | FILE@[0; 81) | ||
2 | USE_ITEM@[0; 6) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 5) | ||
6 | STAR@[4; 5) | ||
7 | SEMI@[5; 6) | ||
8 | WHITESPACE@[6; 7) | ||
9 | USE_ITEM@[7; 15) | ||
10 | USE_KW@[7; 10) | ||
11 | WHITESPACE@[10; 11) | ||
12 | USE_TREE@[11; 14) | ||
13 | COLONCOLON@[11; 13) | ||
14 | STAR@[13; 14) | ||
15 | SEMI@[14; 15) | ||
16 | WHITESPACE@[15; 16) | ||
17 | USE_ITEM@[16; 25) | ||
18 | USE_KW@[16; 19) | ||
19 | WHITESPACE@[19; 20) | ||
20 | USE_TREE@[20; 24) | ||
21 | COLONCOLON@[20; 22) | ||
22 | L_CURLY@[22; 23) | ||
23 | R_CURLY@[23; 24) | ||
24 | SEMI@[24; 25) | ||
25 | WHITESPACE@[25; 26) | ||
26 | USE_ITEM@[26; 33) | ||
27 | USE_KW@[26; 29) | ||
28 | WHITESPACE@[29; 30) | ||
29 | USE_TREE@[30; 32) | ||
30 | L_CURLY@[30; 31) | ||
31 | R_CURLY@[31; 32) | ||
32 | SEMI@[32; 33) | ||
33 | WHITESPACE@[33; 34) | ||
34 | USE_ITEM@[34; 45) | ||
35 | USE_KW@[34; 37) | ||
36 | WHITESPACE@[37; 38) | ||
37 | USE_TREE@[38; 44) | ||
38 | PATH@[38; 41) | ||
39 | PATH_SEGMENT@[38; 41) | ||
40 | NAME_REF@[38; 41) | ||
41 | IDENT@[38; 41) "foo" | ||
42 | COLONCOLON@[41; 43) | ||
43 | STAR@[43; 44) | ||
44 | SEMI@[44; 45) | ||
45 | WHITESPACE@[45; 46) | ||
46 | USE_ITEM@[46; 58) | ||
47 | USE_KW@[46; 49) | ||
48 | WHITESPACE@[49; 50) | ||
49 | USE_TREE@[50; 57) | ||
50 | PATH@[50; 53) | ||
51 | PATH_SEGMENT@[50; 53) | ||
52 | NAME_REF@[50; 53) | ||
53 | IDENT@[50; 53) "foo" | ||
54 | COLONCOLON@[53; 55) | ||
55 | L_CURLY@[55; 56) | ||
56 | R_CURLY@[56; 57) | ||
57 | SEMI@[57; 58) | ||
58 | WHITESPACE@[58; 59) | ||
59 | USE_ITEM@[59; 80) | ||
60 | USE_KW@[59; 62) | ||
61 | WHITESPACE@[62; 63) | ||
62 | USE_TREE@[63; 79) | ||
63 | PATH@[63; 68) | ||
64 | PATH_SEGMENT@[63; 68) | ||
65 | COLONCOLON@[63; 65) | ||
66 | NAME_REF@[65; 68) | ||
67 | IDENT@[65; 68) "foo" | ||
68 | COLONCOLON@[68; 70) | ||
69 | L_CURLY@[70; 71) | ||
70 | USE_TREE@[71; 72) | ||
71 | PATH@[71; 72) | ||
72 | PATH_SEGMENT@[71; 72) | ||
73 | NAME_REF@[71; 72) | ||
74 | IDENT@[71; 72) "a" | ||
75 | COMMA@[72; 73) | ||
76 | WHITESPACE@[73; 74) | ||
77 | USE_TREE@[74; 75) | ||
78 | PATH@[74; 75) | ||
79 | PATH_SEGMENT@[74; 75) | ||
80 | NAME_REF@[74; 75) | ||
81 | IDENT@[74; 75) "b" | ||
82 | COMMA@[75; 76) | ||
83 | WHITESPACE@[76; 77) | ||
84 | USE_TREE@[77; 78) | ||
85 | PATH@[77; 78) | ||
86 | PATH_SEGMENT@[77; 78) | ||
87 | NAME_REF@[77; 78) | ||
88 | IDENT@[77; 78) "c" | ||
89 | R_CURLY@[78; 79) | ||
90 | SEMI@[79; 80) | ||
91 | WHITESPACE@[80; 81) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.rs b/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.rs new file mode 100644 index 000000000..46a0783a2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | use foo as bar; | ||
2 | use foo::{a as b, *, ::*, ::foo as x}; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.txt b/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.txt new file mode 100644 index 000000000..4438e417b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.txt | |||
@@ -0,0 +1,64 @@ | |||
1 | FILE@[0; 55) | ||
2 | USE_ITEM@[0; 15) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 14) | ||
6 | PATH@[4; 7) | ||
7 | PATH_SEGMENT@[4; 7) | ||
8 | NAME_REF@[4; 7) | ||
9 | IDENT@[4; 7) "foo" | ||
10 | WHITESPACE@[7; 8) | ||
11 | ALIAS@[8; 14) | ||
12 | AS_KW@[8; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | NAME@[11; 14) | ||
15 | IDENT@[11; 14) "bar" | ||
16 | SEMI@[14; 15) | ||
17 | WHITESPACE@[15; 16) | ||
18 | USE_ITEM@[16; 54) | ||
19 | USE_KW@[16; 19) | ||
20 | WHITESPACE@[19; 20) | ||
21 | USE_TREE@[20; 53) | ||
22 | PATH@[20; 23) | ||
23 | PATH_SEGMENT@[20; 23) | ||
24 | NAME_REF@[20; 23) | ||
25 | IDENT@[20; 23) "foo" | ||
26 | COLONCOLON@[23; 25) | ||
27 | L_CURLY@[25; 26) | ||
28 | USE_TREE@[26; 32) | ||
29 | PATH@[26; 27) | ||
30 | PATH_SEGMENT@[26; 27) | ||
31 | NAME_REF@[26; 27) | ||
32 | IDENT@[26; 27) "a" | ||
33 | WHITESPACE@[27; 28) | ||
34 | ALIAS@[28; 32) | ||
35 | AS_KW@[28; 30) | ||
36 | WHITESPACE@[30; 31) | ||
37 | NAME@[31; 32) | ||
38 | IDENT@[31; 32) "b" | ||
39 | COMMA@[32; 33) | ||
40 | WHITESPACE@[33; 34) | ||
41 | USE_TREE@[34; 35) | ||
42 | STAR@[34; 35) | ||
43 | COMMA@[35; 36) | ||
44 | WHITESPACE@[36; 37) | ||
45 | USE_TREE@[37; 40) | ||
46 | COLONCOLON@[37; 39) | ||
47 | STAR@[39; 40) | ||
48 | COMMA@[40; 41) | ||
49 | WHITESPACE@[41; 42) | ||
50 | USE_TREE@[42; 52) | ||
51 | PATH@[42; 47) | ||
52 | PATH_SEGMENT@[42; 47) | ||
53 | COLONCOLON@[42; 44) | ||
54 | NAME_REF@[44; 47) | ||
55 | IDENT@[44; 47) "foo" | ||
56 | WHITESPACE@[47; 48) | ||
57 | ALIAS@[48; 52) | ||
58 | AS_KW@[48; 50) | ||
59 | WHITESPACE@[50; 51) | ||
60 | NAME@[51; 52) | ||
61 | IDENT@[51; 52) "x" | ||
62 | R_CURLY@[52; 53) | ||
63 | SEMI@[53; 54) | ||
64 | WHITESPACE@[54; 55) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.rs b/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.rs new file mode 100644 index 000000000..69638350c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.rs | |||
@@ -0,0 +1,10 @@ | |||
1 | struct A; | ||
2 | struct B {} | ||
3 | struct C(); | ||
4 | |||
5 | struct D { | ||
6 | a: u32, | ||
7 | pub b: u32 | ||
8 | } | ||
9 | |||
10 | struct E(pub x, y,); | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.txt b/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.txt new file mode 100644 index 000000000..5dd480d1b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.txt | |||
@@ -0,0 +1,89 @@ | |||
1 | FILE@[0; 97) | ||
2 | STRUCT_ITEM@[0; 9) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "A" | ||
7 | SEMI@[8; 9) | ||
8 | WHITESPACE@[9; 10) | ||
9 | STRUCT_ITEM@[10; 21) | ||
10 | STRUCT_KW@[10; 16) | ||
11 | WHITESPACE@[16; 17) | ||
12 | NAME@[17; 18) | ||
13 | IDENT@[17; 18) "B" | ||
14 | WHITESPACE@[18; 19) | ||
15 | L_CURLY@[19; 20) | ||
16 | R_CURLY@[20; 21) | ||
17 | WHITESPACE@[21; 22) | ||
18 | STRUCT_ITEM@[22; 33) | ||
19 | STRUCT_KW@[22; 28) | ||
20 | WHITESPACE@[28; 29) | ||
21 | NAME@[29; 30) | ||
22 | IDENT@[29; 30) "C" | ||
23 | L_PAREN@[30; 31) | ||
24 | R_PAREN@[31; 32) | ||
25 | SEMI@[32; 33) | ||
26 | WHITESPACE@[33; 35) | ||
27 | STRUCT_ITEM@[35; 74) | ||
28 | STRUCT_KW@[35; 41) | ||
29 | WHITESPACE@[41; 42) | ||
30 | NAME@[42; 43) | ||
31 | IDENT@[42; 43) "D" | ||
32 | WHITESPACE@[43; 44) | ||
33 | L_CURLY@[44; 45) | ||
34 | WHITESPACE@[45; 50) | ||
35 | NAMED_FIELD@[50; 56) | ||
36 | NAME@[50; 51) | ||
37 | IDENT@[50; 51) "a" | ||
38 | COLON@[51; 52) | ||
39 | WHITESPACE@[52; 53) | ||
40 | PATH_TYPE@[53; 56) | ||
41 | PATH@[53; 56) | ||
42 | PATH_SEGMENT@[53; 56) | ||
43 | NAME_REF@[53; 56) | ||
44 | IDENT@[53; 56) "u32" | ||
45 | COMMA@[56; 57) | ||
46 | WHITESPACE@[57; 62) | ||
47 | NAMED_FIELD@[62; 72) | ||
48 | VISIBILITY@[62; 65) | ||
49 | PUB_KW@[62; 65) | ||
50 | WHITESPACE@[65; 66) | ||
51 | NAME@[66; 67) | ||
52 | IDENT@[66; 67) "b" | ||
53 | COLON@[67; 68) | ||
54 | WHITESPACE@[68; 69) | ||
55 | PATH_TYPE@[69; 72) | ||
56 | PATH@[69; 72) | ||
57 | PATH_SEGMENT@[69; 72) | ||
58 | NAME_REF@[69; 72) | ||
59 | IDENT@[69; 72) "u32" | ||
60 | WHITESPACE@[72; 73) | ||
61 | R_CURLY@[73; 74) | ||
62 | WHITESPACE@[74; 76) | ||
63 | STRUCT_ITEM@[76; 96) | ||
64 | STRUCT_KW@[76; 82) | ||
65 | WHITESPACE@[82; 83) | ||
66 | NAME@[83; 84) | ||
67 | IDENT@[83; 84) "E" | ||
68 | L_PAREN@[84; 85) | ||
69 | POS_FIELD@[85; 90) | ||
70 | VISIBILITY@[85; 88) | ||
71 | PUB_KW@[85; 88) | ||
72 | WHITESPACE@[88; 89) | ||
73 | PATH_TYPE@[89; 90) | ||
74 | PATH@[89; 90) | ||
75 | PATH_SEGMENT@[89; 90) | ||
76 | NAME_REF@[89; 90) | ||
77 | IDENT@[89; 90) "x" | ||
78 | COMMA@[90; 91) | ||
79 | WHITESPACE@[91; 92) | ||
80 | POS_FIELD@[92; 93) | ||
81 | PATH_TYPE@[92; 93) | ||
82 | PATH@[92; 93) | ||
83 | PATH_SEGMENT@[92; 93) | ||
84 | NAME_REF@[92; 93) | ||
85 | IDENT@[92; 93) "y" | ||
86 | COMMA@[93; 94) | ||
87 | R_PAREN@[94; 95) | ||
88 | SEMI@[95; 96) | ||
89 | WHITESPACE@[96; 97) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.rs b/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.rs new file mode 100644 index 000000000..fe0a7bb97 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | #[foo(a,)] | ||
2 | fn foo() {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.txt b/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.txt new file mode 100644 index 000000000..69724cdc8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.txt | |||
@@ -0,0 +1,26 @@ | |||
1 | FILE@[0; 23) | ||
2 | FUNCTION@[0; 22) | ||
3 | ATTR@[0; 10) | ||
4 | POUND@[0; 1) | ||
5 | L_BRACK@[1; 2) | ||
6 | META_ITEM@[2; 9) | ||
7 | IDENT@[2; 5) "foo" | ||
8 | L_PAREN@[5; 6) | ||
9 | META_ITEM@[6; 7) | ||
10 | IDENT@[6; 7) "a" | ||
11 | COMMA@[7; 8) | ||
12 | R_PAREN@[8; 9) | ||
13 | R_BRACK@[9; 10) | ||
14 | WHITESPACE@[10; 11) | ||
15 | FN_KW@[11; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | NAME@[14; 17) | ||
18 | IDENT@[14; 17) "foo" | ||
19 | PARAM_LIST@[17; 19) | ||
20 | L_PAREN@[17; 18) | ||
21 | R_PAREN@[18; 19) | ||
22 | WHITESPACE@[19; 20) | ||
23 | BLOCK_EXPR@[20; 22) | ||
24 | L_CURLY@[20; 21) | ||
25 | R_CURLY@[21; 22) | ||
26 | WHITESPACE@[22; 23) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.rs b/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.rs new file mode 100644 index 000000000..88c544923 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.rs | |||
@@ -0,0 +1,17 @@ | |||
1 | struct S1<T>; | ||
2 | struct S2<T>(u32); | ||
3 | struct S3<T> { u: u32 } | ||
4 | |||
5 | struct S4<>; | ||
6 | struct S5<'a>; | ||
7 | struct S6<'a:>; | ||
8 | struct S7<'a: 'b>; | ||
9 | struct S8<'a: 'b + >; | ||
10 | struct S9<'a: 'b + 'c>; | ||
11 | struct S10<'a,>; | ||
12 | struct S11<'a, 'b>; | ||
13 | struct S12<'a: 'b+, 'b: 'c,>; | ||
14 | |||
15 | struct S13<T>; | ||
16 | struct S14<T, U>; | ||
17 | struct S15<'a, T, U>; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.txt b/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.txt new file mode 100644 index 000000000..6457c2639 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.txt | |||
@@ -0,0 +1,255 @@ | |||
1 | FILE@[0; 290) | ||
2 | STRUCT_ITEM@[0; 13) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 9) | ||
6 | IDENT@[7; 9) "S1" | ||
7 | TYPE_PARAM_LIST@[9; 12) | ||
8 | L_ANGLE@[9; 10) | ||
9 | TYPE_PARAM@[10; 11) | ||
10 | NAME@[10; 11) | ||
11 | IDENT@[10; 11) "T" | ||
12 | R_ANGLE@[11; 12) | ||
13 | SEMI@[12; 13) | ||
14 | WHITESPACE@[13; 14) | ||
15 | STRUCT_ITEM@[14; 32) | ||
16 | STRUCT_KW@[14; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | NAME@[21; 23) | ||
19 | IDENT@[21; 23) "S2" | ||
20 | TYPE_PARAM_LIST@[23; 26) | ||
21 | L_ANGLE@[23; 24) | ||
22 | TYPE_PARAM@[24; 25) | ||
23 | NAME@[24; 25) | ||
24 | IDENT@[24; 25) "T" | ||
25 | R_ANGLE@[25; 26) | ||
26 | L_PAREN@[26; 27) | ||
27 | POS_FIELD@[27; 30) | ||
28 | PATH_TYPE@[27; 30) | ||
29 | PATH@[27; 30) | ||
30 | PATH_SEGMENT@[27; 30) | ||
31 | NAME_REF@[27; 30) | ||
32 | IDENT@[27; 30) "u32" | ||
33 | R_PAREN@[30; 31) | ||
34 | SEMI@[31; 32) | ||
35 | WHITESPACE@[32; 33) | ||
36 | STRUCT_ITEM@[33; 56) | ||
37 | STRUCT_KW@[33; 39) | ||
38 | WHITESPACE@[39; 40) | ||
39 | NAME@[40; 42) | ||
40 | IDENT@[40; 42) "S3" | ||
41 | TYPE_PARAM_LIST@[42; 45) | ||
42 | L_ANGLE@[42; 43) | ||
43 | TYPE_PARAM@[43; 44) | ||
44 | NAME@[43; 44) | ||
45 | IDENT@[43; 44) "T" | ||
46 | R_ANGLE@[44; 45) | ||
47 | WHITESPACE@[45; 46) | ||
48 | L_CURLY@[46; 47) | ||
49 | WHITESPACE@[47; 48) | ||
50 | NAMED_FIELD@[48; 54) | ||
51 | NAME@[48; 49) | ||
52 | IDENT@[48; 49) "u" | ||
53 | COLON@[49; 50) | ||
54 | WHITESPACE@[50; 51) | ||
55 | PATH_TYPE@[51; 54) | ||
56 | PATH@[51; 54) | ||
57 | PATH_SEGMENT@[51; 54) | ||
58 | NAME_REF@[51; 54) | ||
59 | IDENT@[51; 54) "u32" | ||
60 | WHITESPACE@[54; 55) | ||
61 | R_CURLY@[55; 56) | ||
62 | WHITESPACE@[56; 58) | ||
63 | STRUCT_ITEM@[58; 70) | ||
64 | STRUCT_KW@[58; 64) | ||
65 | WHITESPACE@[64; 65) | ||
66 | NAME@[65; 67) | ||
67 | IDENT@[65; 67) "S4" | ||
68 | TYPE_PARAM_LIST@[67; 69) | ||
69 | L_ANGLE@[67; 68) | ||
70 | R_ANGLE@[68; 69) | ||
71 | SEMI@[69; 70) | ||
72 | WHITESPACE@[70; 71) | ||
73 | STRUCT_ITEM@[71; 85) | ||
74 | STRUCT_KW@[71; 77) | ||
75 | WHITESPACE@[77; 78) | ||
76 | NAME@[78; 80) | ||
77 | IDENT@[78; 80) "S5" | ||
78 | TYPE_PARAM_LIST@[80; 84) | ||
79 | L_ANGLE@[80; 81) | ||
80 | LIFETIME_PARAM@[81; 83) | ||
81 | LIFETIME@[81; 83) "'a" | ||
82 | R_ANGLE@[83; 84) | ||
83 | SEMI@[84; 85) | ||
84 | WHITESPACE@[85; 86) | ||
85 | STRUCT_ITEM@[86; 101) | ||
86 | STRUCT_KW@[86; 92) | ||
87 | WHITESPACE@[92; 93) | ||
88 | NAME@[93; 95) | ||
89 | IDENT@[93; 95) "S6" | ||
90 | TYPE_PARAM_LIST@[95; 100) | ||
91 | L_ANGLE@[95; 96) | ||
92 | LIFETIME_PARAM@[96; 99) | ||
93 | LIFETIME@[96; 98) "'a" | ||
94 | COLON@[98; 99) | ||
95 | R_ANGLE@[99; 100) | ||
96 | SEMI@[100; 101) | ||
97 | WHITESPACE@[101; 102) | ||
98 | STRUCT_ITEM@[102; 120) | ||
99 | STRUCT_KW@[102; 108) | ||
100 | WHITESPACE@[108; 109) | ||
101 | NAME@[109; 111) | ||
102 | IDENT@[109; 111) "S7" | ||
103 | TYPE_PARAM_LIST@[111; 119) | ||
104 | L_ANGLE@[111; 112) | ||
105 | LIFETIME_PARAM@[112; 118) | ||
106 | LIFETIME@[112; 114) "'a" | ||
107 | COLON@[114; 115) | ||
108 | WHITESPACE@[115; 116) | ||
109 | LIFETIME@[116; 118) "'b" | ||
110 | R_ANGLE@[118; 119) | ||
111 | SEMI@[119; 120) | ||
112 | WHITESPACE@[120; 121) | ||
113 | STRUCT_ITEM@[121; 142) | ||
114 | STRUCT_KW@[121; 127) | ||
115 | WHITESPACE@[127; 128) | ||
116 | NAME@[128; 130) | ||
117 | IDENT@[128; 130) "S8" | ||
118 | TYPE_PARAM_LIST@[130; 141) | ||
119 | L_ANGLE@[130; 131) | ||
120 | LIFETIME_PARAM@[131; 139) | ||
121 | LIFETIME@[131; 133) "'a" | ||
122 | COLON@[133; 134) | ||
123 | WHITESPACE@[134; 135) | ||
124 | LIFETIME@[135; 137) "'b" | ||
125 | WHITESPACE@[137; 138) | ||
126 | PLUS@[138; 139) | ||
127 | WHITESPACE@[139; 140) | ||
128 | R_ANGLE@[140; 141) | ||
129 | SEMI@[141; 142) | ||
130 | WHITESPACE@[142; 143) | ||
131 | STRUCT_ITEM@[143; 166) | ||
132 | STRUCT_KW@[143; 149) | ||
133 | WHITESPACE@[149; 150) | ||
134 | NAME@[150; 152) | ||
135 | IDENT@[150; 152) "S9" | ||
136 | TYPE_PARAM_LIST@[152; 165) | ||
137 | L_ANGLE@[152; 153) | ||
138 | LIFETIME_PARAM@[153; 164) | ||
139 | LIFETIME@[153; 155) "'a" | ||
140 | COLON@[155; 156) | ||
141 | WHITESPACE@[156; 157) | ||
142 | LIFETIME@[157; 159) "'b" | ||
143 | WHITESPACE@[159; 160) | ||
144 | PLUS@[160; 161) | ||
145 | WHITESPACE@[161; 162) | ||
146 | LIFETIME@[162; 164) "'c" | ||
147 | R_ANGLE@[164; 165) | ||
148 | SEMI@[165; 166) | ||
149 | WHITESPACE@[166; 167) | ||
150 | STRUCT_ITEM@[167; 183) | ||
151 | STRUCT_KW@[167; 173) | ||
152 | WHITESPACE@[173; 174) | ||
153 | NAME@[174; 177) | ||
154 | IDENT@[174; 177) "S10" | ||
155 | TYPE_PARAM_LIST@[177; 182) | ||
156 | L_ANGLE@[177; 178) | ||
157 | LIFETIME_PARAM@[178; 180) | ||
158 | LIFETIME@[178; 180) "'a" | ||
159 | COMMA@[180; 181) | ||
160 | R_ANGLE@[181; 182) | ||
161 | SEMI@[182; 183) | ||
162 | WHITESPACE@[183; 184) | ||
163 | STRUCT_ITEM@[184; 203) | ||
164 | STRUCT_KW@[184; 190) | ||
165 | WHITESPACE@[190; 191) | ||
166 | NAME@[191; 194) | ||
167 | IDENT@[191; 194) "S11" | ||
168 | TYPE_PARAM_LIST@[194; 202) | ||
169 | L_ANGLE@[194; 195) | ||
170 | LIFETIME_PARAM@[195; 197) | ||
171 | LIFETIME@[195; 197) "'a" | ||
172 | COMMA@[197; 198) | ||
173 | WHITESPACE@[198; 199) | ||
174 | LIFETIME_PARAM@[199; 201) | ||
175 | LIFETIME@[199; 201) "'b" | ||
176 | R_ANGLE@[201; 202) | ||
177 | SEMI@[202; 203) | ||
178 | WHITESPACE@[203; 204) | ||
179 | STRUCT_ITEM@[204; 233) | ||
180 | STRUCT_KW@[204; 210) | ||
181 | WHITESPACE@[210; 211) | ||
182 | NAME@[211; 214) | ||
183 | IDENT@[211; 214) "S12" | ||
184 | TYPE_PARAM_LIST@[214; 232) | ||
185 | L_ANGLE@[214; 215) | ||
186 | LIFETIME_PARAM@[215; 222) | ||
187 | LIFETIME@[215; 217) "'a" | ||
188 | COLON@[217; 218) | ||
189 | WHITESPACE@[218; 219) | ||
190 | LIFETIME@[219; 221) "'b" | ||
191 | PLUS@[221; 222) | ||
192 | COMMA@[222; 223) | ||
193 | WHITESPACE@[223; 224) | ||
194 | LIFETIME_PARAM@[224; 230) | ||
195 | LIFETIME@[224; 226) "'b" | ||
196 | COLON@[226; 227) | ||
197 | WHITESPACE@[227; 228) | ||
198 | LIFETIME@[228; 230) "'c" | ||
199 | COMMA@[230; 231) | ||
200 | R_ANGLE@[231; 232) | ||
201 | SEMI@[232; 233) | ||
202 | WHITESPACE@[233; 235) | ||
203 | STRUCT_ITEM@[235; 249) | ||
204 | STRUCT_KW@[235; 241) | ||
205 | WHITESPACE@[241; 242) | ||
206 | NAME@[242; 245) | ||
207 | IDENT@[242; 245) "S13" | ||
208 | TYPE_PARAM_LIST@[245; 248) | ||
209 | L_ANGLE@[245; 246) | ||
210 | TYPE_PARAM@[246; 247) | ||
211 | NAME@[246; 247) | ||
212 | IDENT@[246; 247) "T" | ||
213 | R_ANGLE@[247; 248) | ||
214 | SEMI@[248; 249) | ||
215 | WHITESPACE@[249; 250) | ||
216 | STRUCT_ITEM@[250; 267) | ||
217 | STRUCT_KW@[250; 256) | ||
218 | WHITESPACE@[256; 257) | ||
219 | NAME@[257; 260) | ||
220 | IDENT@[257; 260) "S14" | ||
221 | TYPE_PARAM_LIST@[260; 266) | ||
222 | L_ANGLE@[260; 261) | ||
223 | TYPE_PARAM@[261; 262) | ||
224 | NAME@[261; 262) | ||
225 | IDENT@[261; 262) "T" | ||
226 | COMMA@[262; 263) | ||
227 | WHITESPACE@[263; 264) | ||
228 | TYPE_PARAM@[264; 265) | ||
229 | NAME@[264; 265) | ||
230 | IDENT@[264; 265) "U" | ||
231 | R_ANGLE@[265; 266) | ||
232 | SEMI@[266; 267) | ||
233 | WHITESPACE@[267; 268) | ||
234 | STRUCT_ITEM@[268; 289) | ||
235 | STRUCT_KW@[268; 274) | ||
236 | WHITESPACE@[274; 275) | ||
237 | NAME@[275; 278) | ||
238 | IDENT@[275; 278) "S15" | ||
239 | TYPE_PARAM_LIST@[278; 288) | ||
240 | L_ANGLE@[278; 279) | ||
241 | LIFETIME_PARAM@[279; 281) | ||
242 | LIFETIME@[279; 281) "'a" | ||
243 | COMMA@[281; 282) | ||
244 | WHITESPACE@[282; 283) | ||
245 | TYPE_PARAM@[283; 284) | ||
246 | NAME@[283; 284) | ||
247 | IDENT@[283; 284) "T" | ||
248 | COMMA@[284; 285) | ||
249 | WHITESPACE@[285; 286) | ||
250 | TYPE_PARAM@[286; 287) | ||
251 | NAME@[286; 287) | ||
252 | IDENT@[286; 287) "U" | ||
253 | R_ANGLE@[287; 288) | ||
254 | SEMI@[288; 289) | ||
255 | WHITESPACE@[289; 290) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0019_enums.rs b/crates/libsyntax2/tests/data/parser/ok/0019_enums.rs new file mode 100644 index 000000000..7a1afa0e6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0019_enums.rs | |||
@@ -0,0 +1,25 @@ | |||
1 | enum E1 { | ||
2 | } | ||
3 | |||
4 | enum E2<T> { | ||
5 | } | ||
6 | |||
7 | enum E3 { | ||
8 | X | ||
9 | } | ||
10 | |||
11 | enum E4 { | ||
12 | X, | ||
13 | } | ||
14 | |||
15 | enum E5 { | ||
16 | A, | ||
17 | B = 92, | ||
18 | C { | ||
19 | a: u32, | ||
20 | pub b: f64, | ||
21 | }, | ||
22 | F {}, | ||
23 | D(u32,), | ||
24 | E(), | ||
25 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0019_enums.txt b/crates/libsyntax2/tests/data/parser/ok/0019_enums.txt new file mode 100644 index 000000000..8650381cd --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0019_enums.txt | |||
@@ -0,0 +1,146 @@ | |||
1 | FILE@[0; 182) | ||
2 | ENUM_ITEM@[0; 11) | ||
3 | ENUM_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 7) | ||
6 | IDENT@[5; 7) "E1" | ||
7 | WHITESPACE@[7; 8) | ||
8 | L_CURLY@[8; 9) | ||
9 | WHITESPACE@[9; 10) | ||
10 | R_CURLY@[10; 11) | ||
11 | WHITESPACE@[11; 13) | ||
12 | ENUM_ITEM@[13; 27) | ||
13 | ENUM_KW@[13; 17) | ||
14 | WHITESPACE@[17; 18) | ||
15 | NAME@[18; 20) | ||
16 | IDENT@[18; 20) "E2" | ||
17 | TYPE_PARAM_LIST@[20; 23) | ||
18 | L_ANGLE@[20; 21) | ||
19 | TYPE_PARAM@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "T" | ||
22 | R_ANGLE@[22; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | L_CURLY@[24; 25) | ||
25 | WHITESPACE@[25; 26) | ||
26 | R_CURLY@[26; 27) | ||
27 | WHITESPACE@[27; 29) | ||
28 | ENUM_ITEM@[29; 46) | ||
29 | ENUM_KW@[29; 33) | ||
30 | WHITESPACE@[33; 34) | ||
31 | NAME@[34; 36) | ||
32 | IDENT@[34; 36) "E3" | ||
33 | WHITESPACE@[36; 37) | ||
34 | L_CURLY@[37; 38) | ||
35 | WHITESPACE@[38; 43) | ||
36 | ENUM_VARIANT@[43; 44) | ||
37 | NAME@[43; 44) | ||
38 | IDENT@[43; 44) "X" | ||
39 | WHITESPACE@[44; 45) | ||
40 | R_CURLY@[45; 46) | ||
41 | WHITESPACE@[46; 48) | ||
42 | ENUM_ITEM@[48; 66) | ||
43 | ENUM_KW@[48; 52) | ||
44 | WHITESPACE@[52; 53) | ||
45 | NAME@[53; 55) | ||
46 | IDENT@[53; 55) "E4" | ||
47 | WHITESPACE@[55; 56) | ||
48 | L_CURLY@[56; 57) | ||
49 | WHITESPACE@[57; 62) | ||
50 | ENUM_VARIANT@[62; 63) | ||
51 | NAME@[62; 63) | ||
52 | IDENT@[62; 63) "X" | ||
53 | COMMA@[63; 64) | ||
54 | WHITESPACE@[64; 65) | ||
55 | R_CURLY@[65; 66) | ||
56 | WHITESPACE@[66; 68) | ||
57 | ENUM_ITEM@[68; 181) | ||
58 | ENUM_KW@[68; 72) | ||
59 | WHITESPACE@[72; 73) | ||
60 | NAME@[73; 75) | ||
61 | IDENT@[73; 75) "E5" | ||
62 | WHITESPACE@[75; 76) | ||
63 | L_CURLY@[76; 77) | ||
64 | WHITESPACE@[77; 82) | ||
65 | ENUM_VARIANT@[82; 83) | ||
66 | NAME@[82; 83) | ||
67 | IDENT@[82; 83) "A" | ||
68 | COMMA@[83; 84) | ||
69 | WHITESPACE@[84; 89) | ||
70 | ENUM_VARIANT@[89; 95) | ||
71 | NAME@[89; 90) | ||
72 | IDENT@[89; 90) "B" | ||
73 | WHITESPACE@[90; 91) | ||
74 | EQ@[91; 92) | ||
75 | WHITESPACE@[92; 93) | ||
76 | LITERAL@[93; 95) | ||
77 | INT_NUMBER@[93; 95) "92" | ||
78 | COMMA@[95; 96) | ||
79 | WHITESPACE@[96; 101) | ||
80 | ENUM_VARIANT@[101; 146) | ||
81 | NAME@[101; 102) | ||
82 | IDENT@[101; 102) "C" | ||
83 | WHITESPACE@[102; 103) | ||
84 | L_CURLY@[103; 104) | ||
85 | WHITESPACE@[104; 113) | ||
86 | NAMED_FIELD@[113; 119) | ||
87 | NAME@[113; 114) | ||
88 | IDENT@[113; 114) "a" | ||
89 | COLON@[114; 115) | ||
90 | WHITESPACE@[115; 116) | ||
91 | PATH_TYPE@[116; 119) | ||
92 | PATH@[116; 119) | ||
93 | PATH_SEGMENT@[116; 119) | ||
94 | NAME_REF@[116; 119) | ||
95 | IDENT@[116; 119) "u32" | ||
96 | COMMA@[119; 120) | ||
97 | WHITESPACE@[120; 129) | ||
98 | NAMED_FIELD@[129; 139) | ||
99 | VISIBILITY@[129; 132) | ||
100 | PUB_KW@[129; 132) | ||
101 | WHITESPACE@[132; 133) | ||
102 | NAME@[133; 134) | ||
103 | IDENT@[133; 134) "b" | ||
104 | COLON@[134; 135) | ||
105 | WHITESPACE@[135; 136) | ||
106 | PATH_TYPE@[136; 139) | ||
107 | PATH@[136; 139) | ||
108 | PATH_SEGMENT@[136; 139) | ||
109 | NAME_REF@[136; 139) | ||
110 | IDENT@[136; 139) "f64" | ||
111 | COMMA@[139; 140) | ||
112 | WHITESPACE@[140; 145) | ||
113 | R_CURLY@[145; 146) | ||
114 | COMMA@[146; 147) | ||
115 | WHITESPACE@[147; 152) | ||
116 | ENUM_VARIANT@[152; 156) | ||
117 | NAME@[152; 153) | ||
118 | IDENT@[152; 153) "F" | ||
119 | WHITESPACE@[153; 154) | ||
120 | L_CURLY@[154; 155) | ||
121 | R_CURLY@[155; 156) | ||
122 | COMMA@[156; 157) | ||
123 | WHITESPACE@[157; 162) | ||
124 | ENUM_VARIANT@[162; 169) | ||
125 | NAME@[162; 163) | ||
126 | IDENT@[162; 163) "D" | ||
127 | L_PAREN@[163; 164) | ||
128 | POS_FIELD@[164; 167) | ||
129 | PATH_TYPE@[164; 167) | ||
130 | PATH@[164; 167) | ||
131 | PATH_SEGMENT@[164; 167) | ||
132 | NAME_REF@[164; 167) | ||
133 | IDENT@[164; 167) "u32" | ||
134 | COMMA@[167; 168) | ||
135 | R_PAREN@[168; 169) | ||
136 | COMMA@[169; 170) | ||
137 | WHITESPACE@[170; 175) | ||
138 | ENUM_VARIANT@[175; 178) | ||
139 | NAME@[175; 176) | ||
140 | IDENT@[175; 176) "E" | ||
141 | L_PAREN@[176; 177) | ||
142 | R_PAREN@[177; 178) | ||
143 | COMMA@[178; 179) | ||
144 | WHITESPACE@[179; 180) | ||
145 | R_CURLY@[180; 181) | ||
146 | WHITESPACE@[181; 182) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.rs b/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.rs new file mode 100644 index 000000000..a1b9f00a4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.rs | |||
@@ -0,0 +1,9 @@ | |||
1 | struct A<T>; | ||
2 | struct B<T:>; | ||
3 | struct C<T: 'a>; | ||
4 | struct D<T: 'a + >; | ||
5 | struct E<T: 'a + 'd >; | ||
6 | struct F<T: 'a + 'd + Clone>; | ||
7 | struct G<T: Clone + Copy>; | ||
8 | struct H<T: ::Foo + self::Bar + 'a>; | ||
9 | struct I<T:, U:,>; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.txt b/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.txt new file mode 100644 index 000000000..fe12cbb94 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.txt | |||
@@ -0,0 +1,193 @@ | |||
1 | FILE@[0; 200) | ||
2 | STRUCT_ITEM@[0; 12) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "A" | ||
7 | TYPE_PARAM_LIST@[8; 11) | ||
8 | L_ANGLE@[8; 9) | ||
9 | TYPE_PARAM@[9; 10) | ||
10 | NAME@[9; 10) | ||
11 | IDENT@[9; 10) "T" | ||
12 | R_ANGLE@[10; 11) | ||
13 | SEMI@[11; 12) | ||
14 | WHITESPACE@[12; 13) | ||
15 | STRUCT_ITEM@[13; 26) | ||
16 | STRUCT_KW@[13; 19) | ||
17 | WHITESPACE@[19; 20) | ||
18 | NAME@[20; 21) | ||
19 | IDENT@[20; 21) "B" | ||
20 | TYPE_PARAM_LIST@[21; 25) | ||
21 | L_ANGLE@[21; 22) | ||
22 | TYPE_PARAM@[22; 24) | ||
23 | NAME@[22; 23) | ||
24 | IDENT@[22; 23) "T" | ||
25 | COLON@[23; 24) | ||
26 | R_ANGLE@[24; 25) | ||
27 | SEMI@[25; 26) | ||
28 | WHITESPACE@[26; 27) | ||
29 | STRUCT_ITEM@[27; 43) | ||
30 | STRUCT_KW@[27; 33) | ||
31 | WHITESPACE@[33; 34) | ||
32 | NAME@[34; 35) | ||
33 | IDENT@[34; 35) "C" | ||
34 | TYPE_PARAM_LIST@[35; 42) | ||
35 | L_ANGLE@[35; 36) | ||
36 | TYPE_PARAM@[36; 41) | ||
37 | NAME@[36; 37) | ||
38 | IDENT@[36; 37) "T" | ||
39 | COLON@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||
41 | LIFETIME@[39; 41) "'a" | ||
42 | R_ANGLE@[41; 42) | ||
43 | SEMI@[42; 43) | ||
44 | WHITESPACE@[43; 44) | ||
45 | STRUCT_ITEM@[44; 63) | ||
46 | STRUCT_KW@[44; 50) | ||
47 | WHITESPACE@[50; 51) | ||
48 | NAME@[51; 52) | ||
49 | IDENT@[51; 52) "D" | ||
50 | TYPE_PARAM_LIST@[52; 62) | ||
51 | L_ANGLE@[52; 53) | ||
52 | TYPE_PARAM@[53; 60) | ||
53 | NAME@[53; 54) | ||
54 | IDENT@[53; 54) "T" | ||
55 | COLON@[54; 55) | ||
56 | WHITESPACE@[55; 56) | ||
57 | LIFETIME@[56; 58) "'a" | ||
58 | WHITESPACE@[58; 59) | ||
59 | PLUS@[59; 60) | ||
60 | WHITESPACE@[60; 61) | ||
61 | R_ANGLE@[61; 62) | ||
62 | SEMI@[62; 63) | ||
63 | WHITESPACE@[63; 64) | ||
64 | STRUCT_ITEM@[64; 86) | ||
65 | STRUCT_KW@[64; 70) | ||
66 | WHITESPACE@[70; 71) | ||
67 | NAME@[71; 72) | ||
68 | IDENT@[71; 72) "E" | ||
69 | TYPE_PARAM_LIST@[72; 85) | ||
70 | L_ANGLE@[72; 73) | ||
71 | TYPE_PARAM@[73; 83) | ||
72 | NAME@[73; 74) | ||
73 | IDENT@[73; 74) "T" | ||
74 | COLON@[74; 75) | ||
75 | WHITESPACE@[75; 76) | ||
76 | LIFETIME@[76; 78) "'a" | ||
77 | WHITESPACE@[78; 79) | ||
78 | PLUS@[79; 80) | ||
79 | WHITESPACE@[80; 81) | ||
80 | LIFETIME@[81; 83) "'d" | ||
81 | WHITESPACE@[83; 84) | ||
82 | R_ANGLE@[84; 85) | ||
83 | SEMI@[85; 86) | ||
84 | WHITESPACE@[86; 87) | ||
85 | STRUCT_ITEM@[87; 116) | ||
86 | STRUCT_KW@[87; 93) | ||
87 | WHITESPACE@[93; 94) | ||
88 | NAME@[94; 95) | ||
89 | IDENT@[94; 95) "F" | ||
90 | TYPE_PARAM_LIST@[95; 115) | ||
91 | L_ANGLE@[95; 96) | ||
92 | TYPE_PARAM@[96; 114) | ||
93 | NAME@[96; 97) | ||
94 | IDENT@[96; 97) "T" | ||
95 | COLON@[97; 98) | ||
96 | WHITESPACE@[98; 99) | ||
97 | LIFETIME@[99; 101) "'a" | ||
98 | WHITESPACE@[101; 102) | ||
99 | PLUS@[102; 103) | ||
100 | WHITESPACE@[103; 104) | ||
101 | LIFETIME@[104; 106) "'d" | ||
102 | WHITESPACE@[106; 107) | ||
103 | PLUS@[107; 108) | ||
104 | WHITESPACE@[108; 109) | ||
105 | PATH@[109; 114) | ||
106 | PATH_SEGMENT@[109; 114) | ||
107 | NAME_REF@[109; 114) | ||
108 | IDENT@[109; 114) "Clone" | ||
109 | R_ANGLE@[114; 115) | ||
110 | SEMI@[115; 116) | ||
111 | WHITESPACE@[116; 117) | ||
112 | STRUCT_ITEM@[117; 143) | ||
113 | STRUCT_KW@[117; 123) | ||
114 | WHITESPACE@[123; 124) | ||
115 | NAME@[124; 125) | ||
116 | IDENT@[124; 125) "G" | ||
117 | TYPE_PARAM_LIST@[125; 142) | ||
118 | L_ANGLE@[125; 126) | ||
119 | TYPE_PARAM@[126; 141) | ||
120 | NAME@[126; 127) | ||
121 | IDENT@[126; 127) "T" | ||
122 | COLON@[127; 128) | ||
123 | WHITESPACE@[128; 129) | ||
124 | PATH@[129; 134) | ||
125 | PATH_SEGMENT@[129; 134) | ||
126 | NAME_REF@[129; 134) | ||
127 | IDENT@[129; 134) "Clone" | ||
128 | WHITESPACE@[134; 135) | ||
129 | PLUS@[135; 136) | ||
130 | WHITESPACE@[136; 137) | ||
131 | PATH@[137; 141) | ||
132 | PATH_SEGMENT@[137; 141) | ||
133 | NAME_REF@[137; 141) | ||
134 | IDENT@[137; 141) "Copy" | ||
135 | R_ANGLE@[141; 142) | ||
136 | SEMI@[142; 143) | ||
137 | WHITESPACE@[143; 144) | ||
138 | STRUCT_ITEM@[144; 180) | ||
139 | STRUCT_KW@[144; 150) | ||
140 | WHITESPACE@[150; 151) | ||
141 | NAME@[151; 152) | ||
142 | IDENT@[151; 152) "H" | ||
143 | TYPE_PARAM_LIST@[152; 179) | ||
144 | L_ANGLE@[152; 153) | ||
145 | TYPE_PARAM@[153; 178) | ||
146 | NAME@[153; 154) | ||
147 | IDENT@[153; 154) "T" | ||
148 | COLON@[154; 155) | ||
149 | WHITESPACE@[155; 156) | ||
150 | PATH@[156; 161) | ||
151 | PATH_SEGMENT@[156; 161) | ||
152 | COLONCOLON@[156; 158) | ||
153 | NAME_REF@[158; 161) | ||
154 | IDENT@[158; 161) "Foo" | ||
155 | WHITESPACE@[161; 162) | ||
156 | PLUS@[162; 163) | ||
157 | WHITESPACE@[163; 164) | ||
158 | PATH@[164; 173) | ||
159 | PATH@[164; 168) | ||
160 | PATH_SEGMENT@[164; 168) | ||
161 | SELF_KW@[164; 168) | ||
162 | COLONCOLON@[168; 170) | ||
163 | PATH_SEGMENT@[170; 173) | ||
164 | NAME_REF@[170; 173) | ||
165 | IDENT@[170; 173) "Bar" | ||
166 | WHITESPACE@[173; 174) | ||
167 | PLUS@[174; 175) | ||
168 | WHITESPACE@[175; 176) | ||
169 | LIFETIME@[176; 178) "'a" | ||
170 | R_ANGLE@[178; 179) | ||
171 | SEMI@[179; 180) | ||
172 | WHITESPACE@[180; 181) | ||
173 | STRUCT_ITEM@[181; 199) | ||
174 | STRUCT_KW@[181; 187) | ||
175 | WHITESPACE@[187; 188) | ||
176 | NAME@[188; 189) | ||
177 | IDENT@[188; 189) "I" | ||
178 | TYPE_PARAM_LIST@[189; 198) | ||
179 | L_ANGLE@[189; 190) | ||
180 | TYPE_PARAM@[190; 192) | ||
181 | NAME@[190; 191) | ||
182 | IDENT@[190; 191) "T" | ||
183 | COLON@[191; 192) | ||
184 | COMMA@[192; 193) | ||
185 | WHITESPACE@[193; 194) | ||
186 | TYPE_PARAM@[194; 196) | ||
187 | NAME@[194; 195) | ||
188 | IDENT@[194; 195) "U" | ||
189 | COLON@[195; 196) | ||
190 | COMMA@[196; 197) | ||
191 | R_ANGLE@[197; 198) | ||
192 | SEMI@[198; 199) | ||
193 | WHITESPACE@[199; 200) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.rs b/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.rs new file mode 100644 index 000000000..e929eef74 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | extern fn foo() { | ||
2 | } | ||
3 | |||
4 | extern "C" fn bar() { | ||
5 | } | ||
6 | |||
7 | extern r"D" fn baz() { | ||
8 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.txt b/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.txt new file mode 100644 index 000000000..07d5cc157 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.txt | |||
@@ -0,0 +1,56 @@ | |||
1 | FILE@[0; 71) | ||
2 | FUNCTION@[0; 19) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) | ||
5 | WHITESPACE@[6; 7) | ||
6 | FN_KW@[7; 9) | ||
7 | WHITESPACE@[9; 10) | ||
8 | NAME@[10; 13) | ||
9 | IDENT@[10; 13) "foo" | ||
10 | PARAM_LIST@[13; 15) | ||
11 | L_PAREN@[13; 14) | ||
12 | R_PAREN@[14; 15) | ||
13 | WHITESPACE@[15; 16) | ||
14 | BLOCK_EXPR@[16; 19) | ||
15 | L_CURLY@[16; 17) | ||
16 | WHITESPACE@[17; 18) | ||
17 | R_CURLY@[18; 19) | ||
18 | WHITESPACE@[19; 21) | ||
19 | FUNCTION@[21; 44) | ||
20 | ABI@[21; 31) | ||
21 | EXTERN_KW@[21; 27) | ||
22 | WHITESPACE@[27; 28) | ||
23 | STRING@[28; 31) | ||
24 | WHITESPACE@[31; 32) | ||
25 | FN_KW@[32; 34) | ||
26 | WHITESPACE@[34; 35) | ||
27 | NAME@[35; 38) | ||
28 | IDENT@[35; 38) "bar" | ||
29 | PARAM_LIST@[38; 40) | ||
30 | L_PAREN@[38; 39) | ||
31 | R_PAREN@[39; 40) | ||
32 | WHITESPACE@[40; 41) | ||
33 | BLOCK_EXPR@[41; 44) | ||
34 | L_CURLY@[41; 42) | ||
35 | WHITESPACE@[42; 43) | ||
36 | R_CURLY@[43; 44) | ||
37 | WHITESPACE@[44; 46) | ||
38 | FUNCTION@[46; 70) | ||
39 | ABI@[46; 57) | ||
40 | EXTERN_KW@[46; 52) | ||
41 | WHITESPACE@[52; 53) | ||
42 | RAW_STRING@[53; 57) | ||
43 | WHITESPACE@[57; 58) | ||
44 | FN_KW@[58; 60) | ||
45 | WHITESPACE@[60; 61) | ||
46 | NAME@[61; 64) | ||
47 | IDENT@[61; 64) "baz" | ||
48 | PARAM_LIST@[64; 66) | ||
49 | L_PAREN@[64; 65) | ||
50 | R_PAREN@[65; 66) | ||
51 | WHITESPACE@[66; 67) | ||
52 | BLOCK_EXPR@[67; 70) | ||
53 | L_CURLY@[67; 68) | ||
54 | WHITESPACE@[68; 69) | ||
55 | R_CURLY@[69; 70) | ||
56 | WHITESPACE@[70; 71) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.rs b/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.rs new file mode 100644 index 000000000..f5fe0e6ef --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | extern { | ||
2 | } | ||
3 | |||
4 | extern "C" { | ||
5 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.txt b/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.txt new file mode 100644 index 000000000..81b92d394 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | FILE@[0; 27) | ||
2 | EXTERN_BLOCK_EXPR@[0; 10) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) | ||
5 | WHITESPACE@[6; 7) | ||
6 | L_CURLY@[7; 8) | ||
7 | WHITESPACE@[8; 9) | ||
8 | R_CURLY@[9; 10) | ||
9 | WHITESPACE@[10; 12) | ||
10 | EXTERN_BLOCK_EXPR@[12; 26) | ||
11 | ABI@[12; 22) | ||
12 | EXTERN_KW@[12; 18) | ||
13 | WHITESPACE@[18; 19) | ||
14 | STRING@[19; 22) | ||
15 | WHITESPACE@[22; 23) | ||
16 | L_CURLY@[23; 24) | ||
17 | WHITESPACE@[24; 25) | ||
18 | R_CURLY@[25; 26) | ||
19 | WHITESPACE@[26; 27) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0023_static_items.rs b/crates/libsyntax2/tests/data/parser/ok/0023_static_items.rs new file mode 100644 index 000000000..5fb92ce33 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0023_static_items.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | static FOO: u32 = 1; | ||
2 | static mut BAR: i32 = 92; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0023_static_items.txt b/crates/libsyntax2/tests/data/parser/ok/0023_static_items.txt new file mode 100644 index 000000000..b8dfdd251 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0023_static_items.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | FILE@[0; 47) | ||
2 | STATIC_ITEM@[0; 20) | ||
3 | STATIC_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 10) | ||
6 | IDENT@[7; 10) "FOO" | ||
7 | COLON@[10; 11) | ||
8 | WHITESPACE@[11; 12) | ||
9 | PATH_TYPE@[12; 15) | ||
10 | PATH@[12; 15) | ||
11 | PATH_SEGMENT@[12; 15) | ||
12 | NAME_REF@[12; 15) | ||
13 | IDENT@[12; 15) "u32" | ||
14 | WHITESPACE@[15; 16) | ||
15 | EQ@[16; 17) | ||
16 | WHITESPACE@[17; 18) | ||
17 | LITERAL@[18; 19) | ||
18 | INT_NUMBER@[18; 19) "1" | ||
19 | SEMI@[19; 20) | ||
20 | WHITESPACE@[20; 21) | ||
21 | STATIC_ITEM@[21; 46) | ||
22 | STATIC_KW@[21; 27) | ||
23 | WHITESPACE@[27; 28) | ||
24 | MUT_KW@[28; 31) | ||
25 | WHITESPACE@[31; 32) | ||
26 | NAME@[32; 35) | ||
27 | IDENT@[32; 35) "BAR" | ||
28 | COLON@[35; 36) | ||
29 | WHITESPACE@[36; 37) | ||
30 | PATH_TYPE@[37; 40) | ||
31 | PATH@[37; 40) | ||
32 | PATH_SEGMENT@[37; 40) | ||
33 | NAME_REF@[37; 40) | ||
34 | IDENT@[37; 40) "i32" | ||
35 | WHITESPACE@[40; 41) | ||
36 | EQ@[41; 42) | ||
37 | WHITESPACE@[42; 43) | ||
38 | LITERAL@[43; 45) | ||
39 | INT_NUMBER@[43; 45) "92" | ||
40 | SEMI@[45; 46) | ||
41 | WHITESPACE@[46; 47) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0024_const_item.rs b/crates/libsyntax2/tests/data/parser/ok/0024_const_item.rs new file mode 100644 index 000000000..7446859b5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0024_const_item.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | const FOO: u32 = 92; | ||
2 | const mut BAR: u32 = 62; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0024_const_item.txt b/crates/libsyntax2/tests/data/parser/ok/0024_const_item.txt new file mode 100644 index 000000000..85083e9c1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0024_const_item.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | FILE@[0; 46) | ||
2 | CONST_ITEM@[0; 20) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | NAME@[6; 9) | ||
6 | IDENT@[6; 9) "FOO" | ||
7 | COLON@[9; 10) | ||
8 | WHITESPACE@[10; 11) | ||
9 | PATH_TYPE@[11; 14) | ||
10 | PATH@[11; 14) | ||
11 | PATH_SEGMENT@[11; 14) | ||
12 | NAME_REF@[11; 14) | ||
13 | IDENT@[11; 14) "u32" | ||
14 | WHITESPACE@[14; 15) | ||
15 | EQ@[15; 16) | ||
16 | WHITESPACE@[16; 17) | ||
17 | LITERAL@[17; 19) | ||
18 | INT_NUMBER@[17; 19) "92" | ||
19 | SEMI@[19; 20) | ||
20 | WHITESPACE@[20; 21) | ||
21 | CONST_ITEM@[21; 45) | ||
22 | CONST_KW@[21; 26) | ||
23 | WHITESPACE@[26; 27) | ||
24 | MUT_KW@[27; 30) | ||
25 | WHITESPACE@[30; 31) | ||
26 | NAME@[31; 34) | ||
27 | IDENT@[31; 34) "BAR" | ||
28 | COLON@[34; 35) | ||
29 | WHITESPACE@[35; 36) | ||
30 | PATH_TYPE@[36; 39) | ||
31 | PATH@[36; 39) | ||
32 | PATH_SEGMENT@[36; 39) | ||
33 | NAME_REF@[36; 39) | ||
34 | IDENT@[36; 39) "u32" | ||
35 | WHITESPACE@[39; 40) | ||
36 | EQ@[40; 41) | ||
37 | WHITESPACE@[41; 42) | ||
38 | LITERAL@[42; 44) | ||
39 | INT_NUMBER@[42; 44) "62" | ||
40 | SEMI@[44; 45) | ||
41 | WHITESPACE@[45; 46) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.rs b/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.rs new file mode 100644 index 000000000..289809809 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | extern fn f() {} | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.txt b/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.txt new file mode 100644 index 000000000..46fb177b2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | FILE@[0; 35) | ||
2 | FUNCTION@[0; 34) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 34) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | FUNCTION@[16; 32) | ||
15 | ABI@[16; 22) | ||
16 | EXTERN_KW@[16; 22) | ||
17 | WHITESPACE@[22; 23) | ||
18 | FN_KW@[23; 25) | ||
19 | WHITESPACE@[25; 26) | ||
20 | NAME@[26; 27) | ||
21 | IDENT@[26; 27) "f" | ||
22 | PARAM_LIST@[27; 29) | ||
23 | L_PAREN@[27; 28) | ||
24 | R_PAREN@[28; 29) | ||
25 | WHITESPACE@[29; 30) | ||
26 | BLOCK_EXPR@[30; 32) | ||
27 | L_CURLY@[30; 31) | ||
28 | R_CURLY@[31; 32) | ||
29 | WHITESPACE@[32; 33) | ||
30 | R_CURLY@[33; 34) | ||
31 | WHITESPACE@[34; 35) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.rs b/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.rs new file mode 100644 index 000000000..7641a3d28 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | const fn f() {} | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.txt b/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.txt new file mode 100644 index 000000000..a450762a8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | FILE@[0; 34) | ||
2 | FUNCTION@[0; 33) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 33) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | FUNCTION@[16; 31) | ||
15 | CONST_KW@[16; 21) | ||
16 | WHITESPACE@[21; 22) | ||
17 | FN_KW@[22; 24) | ||
18 | WHITESPACE@[24; 25) | ||
19 | NAME@[25; 26) | ||
20 | IDENT@[25; 26) "f" | ||
21 | PARAM_LIST@[26; 28) | ||
22 | L_PAREN@[26; 27) | ||
23 | R_PAREN@[27; 28) | ||
24 | WHITESPACE@[28; 29) | ||
25 | BLOCK_EXPR@[29; 31) | ||
26 | L_CURLY@[29; 30) | ||
27 | R_CURLY@[30; 31) | ||
28 | WHITESPACE@[31; 32) | ||
29 | R_CURLY@[32; 33) | ||
30 | WHITESPACE@[33; 34) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.rs b/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.rs new file mode 100644 index 000000000..f3c5ff938 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn main() { | ||
2 | unsafe fn f() {} | ||
3 | unsafe { 92 } | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.txt b/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.txt new file mode 100644 index 000000000..28cd7ad3d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 53) | ||
2 | FUNCTION@[0; 52) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 52) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | FUNCTION@[16; 32) | ||
15 | UNSAFE_KW@[16; 22) | ||
16 | WHITESPACE@[22; 23) | ||
17 | FN_KW@[23; 25) | ||
18 | WHITESPACE@[25; 26) | ||
19 | NAME@[26; 27) | ||
20 | IDENT@[26; 27) "f" | ||
21 | PARAM_LIST@[27; 29) | ||
22 | L_PAREN@[27; 28) | ||
23 | R_PAREN@[28; 29) | ||
24 | WHITESPACE@[29; 30) | ||
25 | BLOCK_EXPR@[30; 32) | ||
26 | L_CURLY@[30; 31) | ||
27 | R_CURLY@[31; 32) | ||
28 | WHITESPACE@[32; 37) | ||
29 | BLOCK_EXPR@[37; 50) | ||
30 | UNSAFE_KW@[37; 43) | ||
31 | WHITESPACE@[43; 44) | ||
32 | L_CURLY@[44; 45) | ||
33 | WHITESPACE@[45; 46) | ||
34 | LITERAL@[46; 48) | ||
35 | INT_NUMBER@[46; 48) "92" | ||
36 | WHITESPACE@[48; 49) | ||
37 | R_CURLY@[49; 50) | ||
38 | WHITESPACE@[50; 51) | ||
39 | R_CURLY@[51; 52) | ||
40 | WHITESPACE@[52; 53) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.rs b/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.rs new file mode 100644 index 000000000..cc9598470 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.rs | |||
@@ -0,0 +1,14 @@ | |||
1 | fn binding_power() { | ||
2 | let x = 1 + 2 * 3 % 4 - 5 / 6; | ||
3 | 1 + 2 * 3; | ||
4 | 1 << 2 + 3; | ||
5 | 1 & 2 >> 3; | ||
6 | 1 ^ 2 & 3; | ||
7 | 1 | 2 ^ 3; | ||
8 | 1 == 2 | 3; | ||
9 | 1 && 2 == 3; | ||
10 | //1 || 2 && 2; | ||
11 | //1 .. 2 || 3; | ||
12 | //1 = 2 .. 3; | ||
13 | //---&*1 - --2 * 9; | ||
14 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.txt b/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.txt new file mode 100644 index 000000000..3fb1ae811 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.txt | |||
@@ -0,0 +1,185 @@ | |||
1 | FILE@[0; 248) | ||
2 | FUNCTION@[0; 247) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 16) | ||
6 | IDENT@[3; 16) "binding_power" | ||
7 | PARAM_LIST@[16; 18) | ||
8 | L_PAREN@[16; 17) | ||
9 | R_PAREN@[17; 18) | ||
10 | WHITESPACE@[18; 19) | ||
11 | BLOCK_EXPR@[19; 247) | ||
12 | L_CURLY@[19; 20) | ||
13 | WHITESPACE@[20; 25) | ||
14 | LET_STMT@[25; 55) | ||
15 | LET_KW@[25; 28) | ||
16 | WHITESPACE@[28; 29) | ||
17 | BIND_PAT@[29; 30) | ||
18 | NAME@[29; 30) | ||
19 | IDENT@[29; 30) "x" | ||
20 | WHITESPACE@[30; 31) | ||
21 | EQ@[31; 32) | ||
22 | WHITESPACE@[32; 33) | ||
23 | BIN_EXPR@[33; 54) | ||
24 | BIN_EXPR@[33; 46) | ||
25 | LITERAL@[33; 34) | ||
26 | INT_NUMBER@[33; 34) "1" | ||
27 | WHITESPACE@[34; 35) | ||
28 | PLUS@[35; 36) | ||
29 | WHITESPACE@[36; 37) | ||
30 | BIN_EXPR@[37; 46) | ||
31 | BIN_EXPR@[37; 42) | ||
32 | LITERAL@[37; 38) | ||
33 | INT_NUMBER@[37; 38) "2" | ||
34 | WHITESPACE@[38; 39) | ||
35 | STAR@[39; 40) | ||
36 | WHITESPACE@[40; 41) | ||
37 | LITERAL@[41; 42) | ||
38 | INT_NUMBER@[41; 42) "3" | ||
39 | WHITESPACE@[42; 43) | ||
40 | PERCENT@[43; 44) | ||
41 | WHITESPACE@[44; 45) | ||
42 | LITERAL@[45; 46) | ||
43 | INT_NUMBER@[45; 46) "4" | ||
44 | WHITESPACE@[46; 47) | ||
45 | MINUS@[47; 48) | ||
46 | WHITESPACE@[48; 49) | ||
47 | BIN_EXPR@[49; 54) | ||
48 | LITERAL@[49; 50) | ||
49 | INT_NUMBER@[49; 50) "5" | ||
50 | WHITESPACE@[50; 51) | ||
51 | SLASH@[51; 52) | ||
52 | WHITESPACE@[52; 53) | ||
53 | LITERAL@[53; 54) | ||
54 | INT_NUMBER@[53; 54) "6" | ||
55 | SEMI@[54; 55) | ||
56 | WHITESPACE@[55; 60) | ||
57 | EXPR_STMT@[60; 70) | ||
58 | BIN_EXPR@[60; 69) | ||
59 | LITERAL@[60; 61) | ||
60 | INT_NUMBER@[60; 61) "1" | ||
61 | WHITESPACE@[61; 62) | ||
62 | PLUS@[62; 63) | ||
63 | WHITESPACE@[63; 64) | ||
64 | BIN_EXPR@[64; 69) | ||
65 | LITERAL@[64; 65) | ||
66 | INT_NUMBER@[64; 65) "2" | ||
67 | WHITESPACE@[65; 66) | ||
68 | STAR@[66; 67) | ||
69 | WHITESPACE@[67; 68) | ||
70 | LITERAL@[68; 69) | ||
71 | INT_NUMBER@[68; 69) "3" | ||
72 | SEMI@[69; 70) | ||
73 | WHITESPACE@[70; 75) | ||
74 | EXPR_STMT@[75; 86) | ||
75 | BIN_EXPR@[75; 85) | ||
76 | LITERAL@[75; 76) | ||
77 | INT_NUMBER@[75; 76) "1" | ||
78 | WHITESPACE@[76; 77) | ||
79 | SHL@[77; 79) | ||
80 | WHITESPACE@[79; 80) | ||
81 | BIN_EXPR@[80; 85) | ||
82 | LITERAL@[80; 81) | ||
83 | INT_NUMBER@[80; 81) "2" | ||
84 | WHITESPACE@[81; 82) | ||
85 | PLUS@[82; 83) | ||
86 | WHITESPACE@[83; 84) | ||
87 | LITERAL@[84; 85) | ||
88 | INT_NUMBER@[84; 85) "3" | ||
89 | SEMI@[85; 86) | ||
90 | WHITESPACE@[86; 91) | ||
91 | EXPR_STMT@[91; 102) | ||
92 | BIN_EXPR@[91; 101) | ||
93 | LITERAL@[91; 92) | ||
94 | INT_NUMBER@[91; 92) "1" | ||
95 | WHITESPACE@[92; 93) | ||
96 | AMP@[93; 94) | ||
97 | WHITESPACE@[94; 95) | ||
98 | BIN_EXPR@[95; 101) | ||
99 | LITERAL@[95; 96) | ||
100 | INT_NUMBER@[95; 96) "2" | ||
101 | WHITESPACE@[96; 97) | ||
102 | SHR@[97; 99) | ||
103 | WHITESPACE@[99; 100) | ||
104 | LITERAL@[100; 101) | ||
105 | INT_NUMBER@[100; 101) "3" | ||
106 | SEMI@[101; 102) | ||
107 | WHITESPACE@[102; 107) | ||
108 | EXPR_STMT@[107; 117) | ||
109 | BIN_EXPR@[107; 116) | ||
110 | LITERAL@[107; 108) | ||
111 | INT_NUMBER@[107; 108) "1" | ||
112 | WHITESPACE@[108; 109) | ||
113 | CARET@[109; 110) | ||
114 | WHITESPACE@[110; 111) | ||
115 | BIN_EXPR@[111; 116) | ||
116 | LITERAL@[111; 112) | ||
117 | INT_NUMBER@[111; 112) "2" | ||
118 | WHITESPACE@[112; 113) | ||
119 | AMP@[113; 114) | ||
120 | WHITESPACE@[114; 115) | ||
121 | LITERAL@[115; 116) | ||
122 | INT_NUMBER@[115; 116) "3" | ||
123 | SEMI@[116; 117) | ||
124 | WHITESPACE@[117; 122) | ||
125 | EXPR_STMT@[122; 132) | ||
126 | BIN_EXPR@[122; 131) | ||
127 | LITERAL@[122; 123) | ||
128 | INT_NUMBER@[122; 123) "1" | ||
129 | WHITESPACE@[123; 124) | ||
130 | PIPE@[124; 125) | ||
131 | WHITESPACE@[125; 126) | ||
132 | BIN_EXPR@[126; 131) | ||
133 | LITERAL@[126; 127) | ||
134 | INT_NUMBER@[126; 127) "2" | ||
135 | WHITESPACE@[127; 128) | ||
136 | CARET@[128; 129) | ||
137 | WHITESPACE@[129; 130) | ||
138 | LITERAL@[130; 131) | ||
139 | INT_NUMBER@[130; 131) "3" | ||
140 | SEMI@[131; 132) | ||
141 | WHITESPACE@[132; 137) | ||
142 | EXPR_STMT@[137; 148) | ||
143 | BIN_EXPR@[137; 147) | ||
144 | LITERAL@[137; 138) | ||
145 | INT_NUMBER@[137; 138) "1" | ||
146 | WHITESPACE@[138; 139) | ||
147 | EQEQ@[139; 141) | ||
148 | WHITESPACE@[141; 142) | ||
149 | BIN_EXPR@[142; 147) | ||
150 | LITERAL@[142; 143) | ||
151 | INT_NUMBER@[142; 143) "2" | ||
152 | WHITESPACE@[143; 144) | ||
153 | PIPE@[144; 145) | ||
154 | WHITESPACE@[145; 146) | ||
155 | LITERAL@[146; 147) | ||
156 | INT_NUMBER@[146; 147) "3" | ||
157 | SEMI@[147; 148) | ||
158 | WHITESPACE@[148; 153) | ||
159 | EXPR_STMT@[153; 165) | ||
160 | BIN_EXPR@[153; 164) | ||
161 | LITERAL@[153; 154) | ||
162 | INT_NUMBER@[153; 154) "1" | ||
163 | WHITESPACE@[154; 155) | ||
164 | AMPAMP@[155; 157) | ||
165 | WHITESPACE@[157; 158) | ||
166 | BIN_EXPR@[158; 164) | ||
167 | LITERAL@[158; 159) | ||
168 | INT_NUMBER@[158; 159) "2" | ||
169 | WHITESPACE@[159; 160) | ||
170 | EQEQ@[160; 162) | ||
171 | WHITESPACE@[162; 163) | ||
172 | LITERAL@[163; 164) | ||
173 | INT_NUMBER@[163; 164) "3" | ||
174 | SEMI@[164; 165) | ||
175 | WHITESPACE@[165; 170) | ||
176 | COMMENT@[170; 184) | ||
177 | WHITESPACE@[184; 189) | ||
178 | COMMENT@[189; 203) | ||
179 | WHITESPACE@[203; 208) | ||
180 | COMMENT@[208; 221) | ||
181 | WHITESPACE@[221; 226) | ||
182 | COMMENT@[226; 245) | ||
183 | WHITESPACE@[245; 246) | ||
184 | R_CURLY@[246; 247) | ||
185 | WHITESPACE@[247; 248) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.rs b/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.rs new file mode 100644 index 000000000..03f4ae7b2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | ..1 + 1; | ||
3 | ..z = 2; | ||
4 | x = false..1 == 1; | ||
5 | let x = 1..; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.txt b/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.txt new file mode 100644 index 000000000..91d5e5bba --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.txt | |||
@@ -0,0 +1,83 @@ | |||
1 | FILE@[0; 79) | ||
2 | FUNCTION@[0; 78) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 78) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 23) | ||
15 | RANGE_EXPR@[15; 22) | ||
16 | DOTDOT@[15; 17) | ||
17 | BIN_EXPR@[17; 22) | ||
18 | LITERAL@[17; 18) | ||
19 | INT_NUMBER@[17; 18) "1" | ||
20 | WHITESPACE@[18; 19) | ||
21 | PLUS@[19; 20) | ||
22 | WHITESPACE@[20; 21) | ||
23 | LITERAL@[21; 22) | ||
24 | INT_NUMBER@[21; 22) "1" | ||
25 | SEMI@[22; 23) | ||
26 | WHITESPACE@[23; 28) | ||
27 | EXPR_STMT@[28; 36) | ||
28 | BIN_EXPR@[28; 35) | ||
29 | RANGE_EXPR@[28; 31) | ||
30 | DOTDOT@[28; 30) | ||
31 | PATH_EXPR@[30; 31) | ||
32 | PATH@[30; 31) | ||
33 | PATH_SEGMENT@[30; 31) | ||
34 | NAME_REF@[30; 31) | ||
35 | IDENT@[30; 31) "z" | ||
36 | WHITESPACE@[31; 32) | ||
37 | EQ@[32; 33) | ||
38 | WHITESPACE@[33; 34) | ||
39 | LITERAL@[34; 35) | ||
40 | INT_NUMBER@[34; 35) "2" | ||
41 | SEMI@[35; 36) | ||
42 | WHITESPACE@[36; 41) | ||
43 | EXPR_STMT@[41; 59) | ||
44 | BIN_EXPR@[41; 58) | ||
45 | PATH_EXPR@[41; 42) | ||
46 | PATH@[41; 42) | ||
47 | PATH_SEGMENT@[41; 42) | ||
48 | NAME_REF@[41; 42) | ||
49 | IDENT@[41; 42) "x" | ||
50 | WHITESPACE@[42; 43) | ||
51 | EQ@[43; 44) | ||
52 | WHITESPACE@[44; 45) | ||
53 | RANGE_EXPR@[45; 58) | ||
54 | LITERAL@[45; 50) | ||
55 | FALSE_KW@[45; 50) | ||
56 | DOTDOT@[50; 52) | ||
57 | BIN_EXPR@[52; 58) | ||
58 | LITERAL@[52; 53) | ||
59 | INT_NUMBER@[52; 53) "1" | ||
60 | WHITESPACE@[53; 54) | ||
61 | EQEQ@[54; 56) | ||
62 | WHITESPACE@[56; 57) | ||
63 | LITERAL@[57; 58) | ||
64 | INT_NUMBER@[57; 58) "1" | ||
65 | SEMI@[58; 59) | ||
66 | WHITESPACE@[59; 64) | ||
67 | LET_STMT@[64; 76) | ||
68 | LET_KW@[64; 67) | ||
69 | WHITESPACE@[67; 68) | ||
70 | BIND_PAT@[68; 69) | ||
71 | NAME@[68; 69) | ||
72 | IDENT@[68; 69) "x" | ||
73 | WHITESPACE@[69; 70) | ||
74 | EQ@[70; 71) | ||
75 | WHITESPACE@[71; 72) | ||
76 | RANGE_EXPR@[72; 75) | ||
77 | LITERAL@[72; 73) | ||
78 | INT_NUMBER@[72; 73) "1" | ||
79 | DOTDOT@[73; 75) | ||
80 | SEMI@[75; 76) | ||
81 | WHITESPACE@[76; 77) | ||
82 | R_CURLY@[77; 78) | ||
83 | WHITESPACE@[78; 79) | ||