diff options
Diffstat (limited to 'crates/ra_syntax/tests/data/parser/inline/ok')
224 files changed, 5936 insertions, 0 deletions
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.rs new file mode 100644 index 000000000..a5ec3239f --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | impl F { | ||
2 | type A: Clone; | ||
3 | const B: i32; | ||
4 | fn foo() {} | ||
5 | fn bar(&self); | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.txt new file mode 100644 index 000000000..998ac3da9 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.txt | |||
@@ -0,0 +1,69 @@ | |||
1 | SOURCE_FILE@[0; 83) | ||
2 | IMPL_ITEM@[0; 82) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "F" | ||
10 | WHITESPACE@[6; 7) | ||
11 | ITEM_LIST@[7; 82) | ||
12 | L_CURLY@[7; 8) | ||
13 | WHITESPACE@[8; 13) | ||
14 | TYPE_DEF@[13; 27) | ||
15 | TYPE_KW@[13; 17) | ||
16 | WHITESPACE@[17; 18) | ||
17 | NAME@[18; 19) | ||
18 | IDENT@[18; 19) "A" | ||
19 | COLON@[19; 20) | ||
20 | WHITESPACE@[20; 21) | ||
21 | PATH_TYPE@[21; 26) | ||
22 | PATH@[21; 26) | ||
23 | PATH_SEGMENT@[21; 26) | ||
24 | NAME_REF@[21; 26) | ||
25 | IDENT@[21; 26) "Clone" | ||
26 | SEMI@[26; 27) | ||
27 | WHITESPACE@[27; 32) | ||
28 | CONST_DEF@[32; 45) | ||
29 | CONST_KW@[32; 37) | ||
30 | WHITESPACE@[37; 38) | ||
31 | NAME@[38; 39) | ||
32 | IDENT@[38; 39) "B" | ||
33 | COLON@[39; 40) | ||
34 | WHITESPACE@[40; 41) | ||
35 | PATH_TYPE@[41; 44) | ||
36 | PATH@[41; 44) | ||
37 | PATH_SEGMENT@[41; 44) | ||
38 | NAME_REF@[41; 44) | ||
39 | IDENT@[41; 44) "i32" | ||
40 | SEMI@[44; 45) | ||
41 | WHITESPACE@[45; 50) | ||
42 | FN_DEF@[50; 61) | ||
43 | FN_KW@[50; 52) | ||
44 | WHITESPACE@[52; 53) | ||
45 | NAME@[53; 56) | ||
46 | IDENT@[53; 56) "foo" | ||
47 | PARAM_LIST@[56; 58) | ||
48 | L_PAREN@[56; 57) | ||
49 | R_PAREN@[57; 58) | ||
50 | WHITESPACE@[58; 59) | ||
51 | BLOCK@[59; 61) | ||
52 | L_CURLY@[59; 60) | ||
53 | R_CURLY@[60; 61) | ||
54 | WHITESPACE@[61; 66) | ||
55 | FN_DEF@[66; 80) | ||
56 | FN_KW@[66; 68) | ||
57 | WHITESPACE@[68; 69) | ||
58 | NAME@[69; 72) | ||
59 | IDENT@[69; 72) "bar" | ||
60 | PARAM_LIST@[72; 79) | ||
61 | L_PAREN@[72; 73) | ||
62 | SELF_PARAM@[73; 78) | ||
63 | AMP@[73; 74) | ||
64 | SELF_KW@[74; 78) | ||
65 | R_PAREN@[78; 79) | ||
66 | SEMI@[79; 80) | ||
67 | WHITESPACE@[80; 81) | ||
68 | R_CURLY@[81; 82) | ||
69 | WHITESPACE@[82; 83) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0002_use_tree_list.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0002_use_tree_list.rs new file mode 100644 index 000000000..06c387cee --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0002_use_tree_list.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | use {crate::path::from::root, or::path::from::crate_name}; // Rust 2018 (with a crate named `or`) | ||
2 | use {path::from::root}; // Rust 2015 | ||
3 | use ::{some::arbritrary::path}; // Rust 2015 | ||
4 | use ::{{{crate::export}}}; // Nonsensical but perfectly legal nestnig | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0002_use_tree_list.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0002_use_tree_list.txt new file mode 100644 index 000000000..89a0b9f2a --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0002_use_tree_list.txt | |||
@@ -0,0 +1,135 @@ | |||
1 | SOURCE_FILE@[0; 250) | ||
2 | USE_ITEM@[0; 58) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 57) | ||
6 | USE_TREE_LIST@[4; 57) | ||
7 | L_CURLY@[4; 5) | ||
8 | USE_TREE@[5; 28) | ||
9 | PATH@[5; 28) | ||
10 | PATH@[5; 22) | ||
11 | PATH@[5; 16) | ||
12 | PATH@[5; 10) | ||
13 | PATH_SEGMENT@[5; 10) | ||
14 | CRATE_KW@[5; 10) | ||
15 | COLONCOLON@[10; 12) | ||
16 | PATH_SEGMENT@[12; 16) | ||
17 | NAME_REF@[12; 16) | ||
18 | IDENT@[12; 16) "path" | ||
19 | COLONCOLON@[16; 18) | ||
20 | PATH_SEGMENT@[18; 22) | ||
21 | NAME_REF@[18; 22) | ||
22 | IDENT@[18; 22) "from" | ||
23 | COLONCOLON@[22; 24) | ||
24 | PATH_SEGMENT@[24; 28) | ||
25 | NAME_REF@[24; 28) | ||
26 | IDENT@[24; 28) "root" | ||
27 | COMMA@[28; 29) | ||
28 | WHITESPACE@[29; 30) | ||
29 | USE_TREE@[30; 56) | ||
30 | PATH@[30; 56) | ||
31 | PATH@[30; 44) | ||
32 | PATH@[30; 38) | ||
33 | PATH@[30; 32) | ||
34 | PATH_SEGMENT@[30; 32) | ||
35 | NAME_REF@[30; 32) | ||
36 | IDENT@[30; 32) "or" | ||
37 | COLONCOLON@[32; 34) | ||
38 | PATH_SEGMENT@[34; 38) | ||
39 | NAME_REF@[34; 38) | ||
40 | IDENT@[34; 38) "path" | ||
41 | COLONCOLON@[38; 40) | ||
42 | PATH_SEGMENT@[40; 44) | ||
43 | NAME_REF@[40; 44) | ||
44 | IDENT@[40; 44) "from" | ||
45 | COLONCOLON@[44; 46) | ||
46 | PATH_SEGMENT@[46; 56) | ||
47 | NAME_REF@[46; 56) | ||
48 | IDENT@[46; 56) "crate_name" | ||
49 | R_CURLY@[56; 57) | ||
50 | SEMI@[57; 58) | ||
51 | WHITESPACE@[58; 59) | ||
52 | COMMENT@[59; 97) | ||
53 | WHITESPACE@[97; 98) | ||
54 | USE_ITEM@[98; 121) | ||
55 | USE_KW@[98; 101) | ||
56 | WHITESPACE@[101; 102) | ||
57 | USE_TREE@[102; 120) | ||
58 | USE_TREE_LIST@[102; 120) | ||
59 | L_CURLY@[102; 103) | ||
60 | USE_TREE@[103; 119) | ||
61 | PATH@[103; 119) | ||
62 | PATH@[103; 113) | ||
63 | PATH@[103; 107) | ||
64 | PATH_SEGMENT@[103; 107) | ||
65 | NAME_REF@[103; 107) | ||
66 | IDENT@[103; 107) "path" | ||
67 | COLONCOLON@[107; 109) | ||
68 | PATH_SEGMENT@[109; 113) | ||
69 | NAME_REF@[109; 113) | ||
70 | IDENT@[109; 113) "from" | ||
71 | COLONCOLON@[113; 115) | ||
72 | PATH_SEGMENT@[115; 119) | ||
73 | NAME_REF@[115; 119) | ||
74 | IDENT@[115; 119) "root" | ||
75 | R_CURLY@[119; 120) | ||
76 | SEMI@[120; 121) | ||
77 | WHITESPACE@[121; 122) | ||
78 | COMMENT@[122; 134) | ||
79 | WHITESPACE@[134; 135) | ||
80 | USE_ITEM@[135; 166) | ||
81 | USE_KW@[135; 138) | ||
82 | WHITESPACE@[138; 139) | ||
83 | USE_TREE@[139; 165) | ||
84 | COLONCOLON@[139; 141) | ||
85 | USE_TREE_LIST@[141; 165) | ||
86 | L_CURLY@[141; 142) | ||
87 | USE_TREE@[142; 164) | ||
88 | PATH@[142; 164) | ||
89 | PATH@[142; 158) | ||
90 | PATH@[142; 146) | ||
91 | PATH_SEGMENT@[142; 146) | ||
92 | NAME_REF@[142; 146) | ||
93 | IDENT@[142; 146) "some" | ||
94 | COLONCOLON@[146; 148) | ||
95 | PATH_SEGMENT@[148; 158) | ||
96 | NAME_REF@[148; 158) | ||
97 | IDENT@[148; 158) "arbritrary" | ||
98 | COLONCOLON@[158; 160) | ||
99 | PATH_SEGMENT@[160; 164) | ||
100 | NAME_REF@[160; 164) | ||
101 | IDENT@[160; 164) "path" | ||
102 | R_CURLY@[164; 165) | ||
103 | SEMI@[165; 166) | ||
104 | WHITESPACE@[166; 167) | ||
105 | COMMENT@[167; 179) | ||
106 | WHITESPACE@[179; 180) | ||
107 | USE_ITEM@[180; 206) | ||
108 | USE_KW@[180; 183) | ||
109 | WHITESPACE@[183; 184) | ||
110 | USE_TREE@[184; 205) | ||
111 | COLONCOLON@[184; 186) | ||
112 | USE_TREE_LIST@[186; 205) | ||
113 | L_CURLY@[186; 187) | ||
114 | USE_TREE@[187; 204) | ||
115 | USE_TREE_LIST@[187; 204) | ||
116 | L_CURLY@[187; 188) | ||
117 | USE_TREE@[188; 203) | ||
118 | USE_TREE_LIST@[188; 203) | ||
119 | L_CURLY@[188; 189) | ||
120 | USE_TREE@[189; 202) | ||
121 | PATH@[189; 202) | ||
122 | PATH@[189; 194) | ||
123 | PATH_SEGMENT@[189; 194) | ||
124 | CRATE_KW@[189; 194) | ||
125 | COLONCOLON@[194; 196) | ||
126 | PATH_SEGMENT@[196; 202) | ||
127 | NAME_REF@[196; 202) | ||
128 | IDENT@[196; 202) "export" | ||
129 | R_CURLY@[202; 203) | ||
130 | R_CURLY@[203; 204) | ||
131 | R_CURLY@[204; 205) | ||
132 | SEMI@[205; 206) | ||
133 | WHITESPACE@[206; 207) | ||
134 | COMMENT@[207; 249) | ||
135 | WHITESPACE@[249; 250) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0003_where_pred_for.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0003_where_pred_for.rs new file mode 100644 index 000000000..b448c6178 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0003_where_pred_for.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn test<F>() | ||
2 | where | ||
3 | for<'a> F: Fn(&'a str) | ||
4 | { } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0003_where_pred_for.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0003_where_pred_for.txt new file mode 100644 index 000000000..921bdacf4 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0003_where_pred_for.txt | |||
@@ -0,0 +1,58 @@ | |||
1 | SOURCE_FILE@[0; 49) | ||
2 | FN_DEF@[0; 48) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "test" | ||
7 | TYPE_PARAM_LIST@[7; 10) | ||
8 | L_ANGLE@[7; 8) | ||
9 | TYPE_PARAM@[8; 9) | ||
10 | NAME@[8; 9) | ||
11 | IDENT@[8; 9) "F" | ||
12 | R_ANGLE@[9; 10) | ||
13 | PARAM_LIST@[10; 12) | ||
14 | L_PAREN@[10; 11) | ||
15 | R_PAREN@[11; 12) | ||
16 | WHITESPACE@[12; 13) | ||
17 | WHERE_CLAUSE@[13; 44) | ||
18 | WHERE_KW@[13; 18) | ||
19 | WHITESPACE@[18; 22) | ||
20 | WHERE_PRED@[22; 44) | ||
21 | FOR_KW@[22; 25) | ||
22 | TYPE_PARAM_LIST@[25; 29) | ||
23 | L_ANGLE@[25; 26) | ||
24 | LIFETIME_PARAM@[26; 28) | ||
25 | LIFETIME@[26; 28) "'a" | ||
26 | R_ANGLE@[28; 29) | ||
27 | WHITESPACE@[29; 30) | ||
28 | PATH_TYPE@[30; 31) | ||
29 | PATH@[30; 31) | ||
30 | PATH_SEGMENT@[30; 31) | ||
31 | NAME_REF@[30; 31) | ||
32 | IDENT@[30; 31) "F" | ||
33 | COLON@[31; 32) | ||
34 | WHITESPACE@[32; 33) | ||
35 | PATH_TYPE@[33; 44) | ||
36 | PATH@[33; 44) | ||
37 | PATH_SEGMENT@[33; 44) | ||
38 | NAME_REF@[33; 35) | ||
39 | IDENT@[33; 35) "Fn" | ||
40 | PARAM_LIST@[35; 44) | ||
41 | L_PAREN@[35; 36) | ||
42 | PARAM@[36; 43) | ||
43 | REFERENCE_TYPE@[36; 43) | ||
44 | AMP@[36; 37) | ||
45 | LIFETIME@[37; 39) "'a" | ||
46 | WHITESPACE@[39; 40) | ||
47 | PATH_TYPE@[40; 43) | ||
48 | PATH@[40; 43) | ||
49 | PATH_SEGMENT@[40; 43) | ||
50 | NAME_REF@[40; 43) | ||
51 | IDENT@[40; 43) "str" | ||
52 | R_PAREN@[43; 44) | ||
53 | WHITESPACE@[44; 45) | ||
54 | BLOCK@[45; 48) | ||
55 | L_CURLY@[45; 46) | ||
56 | WHITESPACE@[46; 47) | ||
57 | R_CURLY@[47; 48) | ||
58 | WHITESPACE@[48; 49) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.rs new file mode 100644 index 000000000..d8c23c76a --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.rs | |||
@@ -0,0 +1 @@ | |||
type F = Box<Fn(a: i32, &b: &i32, &mut c: &i32, ())>; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.txt new file mode 100644 index 000000000..f2d7e866b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.txt | |||
@@ -0,0 +1,81 @@ | |||
1 | SOURCE_FILE@[0; 54) | ||
2 | TYPE_DEF@[0; 53) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PATH_TYPE@[9; 52) | ||
11 | PATH@[9; 52) | ||
12 | PATH_SEGMENT@[9; 52) | ||
13 | NAME_REF@[9; 12) | ||
14 | IDENT@[9; 12) "Box" | ||
15 | TYPE_ARG_LIST@[12; 52) | ||
16 | L_ANGLE@[12; 13) | ||
17 | TYPE_ARG@[13; 51) | ||
18 | PATH_TYPE@[13; 51) | ||
19 | PATH@[13; 51) | ||
20 | PATH_SEGMENT@[13; 51) | ||
21 | NAME_REF@[13; 15) | ||
22 | IDENT@[13; 15) "Fn" | ||
23 | PARAM_LIST@[15; 51) | ||
24 | L_PAREN@[15; 16) | ||
25 | PARAM@[16; 22) | ||
26 | BIND_PAT@[16; 17) | ||
27 | NAME@[16; 17) | ||
28 | IDENT@[16; 17) "a" | ||
29 | COLON@[17; 18) | ||
30 | WHITESPACE@[18; 19) | ||
31 | PATH_TYPE@[19; 22) | ||
32 | PATH@[19; 22) | ||
33 | PATH_SEGMENT@[19; 22) | ||
34 | NAME_REF@[19; 22) | ||
35 | IDENT@[19; 22) "i32" | ||
36 | COMMA@[22; 23) | ||
37 | WHITESPACE@[23; 24) | ||
38 | PARAM@[24; 32) | ||
39 | REF_PAT@[24; 26) | ||
40 | AMP@[24; 25) | ||
41 | BIND_PAT@[25; 26) | ||
42 | NAME@[25; 26) | ||
43 | IDENT@[25; 26) "b" | ||
44 | COLON@[26; 27) | ||
45 | WHITESPACE@[27; 28) | ||
46 | REFERENCE_TYPE@[28; 32) | ||
47 | AMP@[28; 29) | ||
48 | PATH_TYPE@[29; 32) | ||
49 | PATH@[29; 32) | ||
50 | PATH_SEGMENT@[29; 32) | ||
51 | NAME_REF@[29; 32) | ||
52 | IDENT@[29; 32) "i32" | ||
53 | COMMA@[32; 33) | ||
54 | WHITESPACE@[33; 34) | ||
55 | PARAM@[34; 46) | ||
56 | REF_PAT@[34; 40) | ||
57 | AMP@[34; 35) | ||
58 | MUT_KW@[35; 38) | ||
59 | WHITESPACE@[38; 39) | ||
60 | BIND_PAT@[39; 40) | ||
61 | NAME@[39; 40) | ||
62 | IDENT@[39; 40) "c" | ||
63 | COLON@[40; 41) | ||
64 | WHITESPACE@[41; 42) | ||
65 | REFERENCE_TYPE@[42; 46) | ||
66 | AMP@[42; 43) | ||
67 | PATH_TYPE@[43; 46) | ||
68 | PATH@[43; 46) | ||
69 | PATH_SEGMENT@[43; 46) | ||
70 | NAME_REF@[43; 46) | ||
71 | IDENT@[43; 46) "i32" | ||
72 | COMMA@[46; 47) | ||
73 | WHITESPACE@[47; 48) | ||
74 | PARAM@[48; 50) | ||
75 | TUPLE_TYPE@[48; 50) | ||
76 | L_PAREN@[48; 49) | ||
77 | R_PAREN@[49; 50) | ||
78 | R_PAREN@[50; 51) | ||
79 | R_ANGLE@[51; 52) | ||
80 | SEMI@[52; 53) | ||
81 | WHITESPACE@[53; 54) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0005_function_type_params.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0005_function_type_params.rs new file mode 100644 index 000000000..9df40ed39 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0005_function_type_params.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<T: Clone + Copy>(){} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0005_function_type_params.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0005_function_type_params.txt new file mode 100644 index 000000000..b20f13267 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0005_function_type_params.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | SOURCE_FILE@[0; 28) | ||
2 | FN_DEF@[0; 27) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | TYPE_PARAM_LIST@[6; 23) | ||
8 | L_ANGLE@[6; 7) | ||
9 | TYPE_PARAM@[7; 22) | ||
10 | NAME@[7; 8) | ||
11 | IDENT@[7; 8) "T" | ||
12 | COLON@[8; 9) | ||
13 | WHITESPACE@[9; 10) | ||
14 | PATH_TYPE@[10; 22) | ||
15 | PATH@[10; 15) | ||
16 | PATH_SEGMENT@[10; 15) | ||
17 | NAME_REF@[10; 15) | ||
18 | IDENT@[10; 15) "Clone" | ||
19 | WHITESPACE@[15; 16) | ||
20 | PLUS@[16; 17) | ||
21 | WHITESPACE@[17; 18) | ||
22 | PATH_TYPE@[18; 22) | ||
23 | PATH@[18; 22) | ||
24 | PATH_SEGMENT@[18; 22) | ||
25 | NAME_REF@[18; 22) | ||
26 | IDENT@[18; 22) "Copy" | ||
27 | R_ANGLE@[22; 23) | ||
28 | PARAM_LIST@[23; 25) | ||
29 | L_PAREN@[23; 24) | ||
30 | R_PAREN@[24; 25) | ||
31 | BLOCK@[25; 27) | ||
32 | L_CURLY@[25; 26) | ||
33 | R_CURLY@[26; 27) | ||
34 | WHITESPACE@[27; 28) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0006_self_param.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0006_self_param.rs new file mode 100644 index 000000000..80c0a43f5 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0006_self_param.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | impl S { | ||
2 | fn a(self) {} | ||
3 | fn b(&self,) {} | ||
4 | fn c(&'a self,) {} | ||
5 | fn d(&'a mut self, x: i32) {} | ||
6 | fn e(mut self) {} | ||
7 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0006_self_param.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0006_self_param.txt new file mode 100644 index 000000000..53027c852 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0006_self_param.txt | |||
@@ -0,0 +1,116 @@ | |||
1 | SOURCE_FILE@[0; 128) | ||
2 | IMPL_ITEM@[0; 127) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "S" | ||
10 | WHITESPACE@[6; 7) | ||
11 | ITEM_LIST@[7; 127) | ||
12 | L_CURLY@[7; 8) | ||
13 | WHITESPACE@[8; 13) | ||
14 | FN_DEF@[13; 26) | ||
15 | FN_KW@[13; 15) | ||
16 | WHITESPACE@[15; 16) | ||
17 | NAME@[16; 17) | ||
18 | IDENT@[16; 17) "a" | ||
19 | PARAM_LIST@[17; 23) | ||
20 | L_PAREN@[17; 18) | ||
21 | SELF_PARAM@[18; 22) | ||
22 | SELF_KW@[18; 22) | ||
23 | R_PAREN@[22; 23) | ||
24 | WHITESPACE@[23; 24) | ||
25 | BLOCK@[24; 26) | ||
26 | L_CURLY@[24; 25) | ||
27 | R_CURLY@[25; 26) | ||
28 | WHITESPACE@[26; 31) | ||
29 | FN_DEF@[31; 46) | ||
30 | FN_KW@[31; 33) | ||
31 | WHITESPACE@[33; 34) | ||
32 | NAME@[34; 35) | ||
33 | IDENT@[34; 35) "b" | ||
34 | PARAM_LIST@[35; 43) | ||
35 | L_PAREN@[35; 36) | ||
36 | SELF_PARAM@[36; 41) | ||
37 | AMP@[36; 37) | ||
38 | SELF_KW@[37; 41) | ||
39 | COMMA@[41; 42) | ||
40 | R_PAREN@[42; 43) | ||
41 | WHITESPACE@[43; 44) | ||
42 | BLOCK@[44; 46) | ||
43 | L_CURLY@[44; 45) | ||
44 | R_CURLY@[45; 46) | ||
45 | WHITESPACE@[46; 51) | ||
46 | FN_DEF@[51; 69) | ||
47 | FN_KW@[51; 53) | ||
48 | WHITESPACE@[53; 54) | ||
49 | NAME@[54; 55) | ||
50 | IDENT@[54; 55) "c" | ||
51 | PARAM_LIST@[55; 66) | ||
52 | L_PAREN@[55; 56) | ||
53 | SELF_PARAM@[56; 64) | ||
54 | AMP@[56; 57) | ||
55 | LIFETIME@[57; 59) "'a" | ||
56 | WHITESPACE@[59; 60) | ||
57 | SELF_KW@[60; 64) | ||
58 | COMMA@[64; 65) | ||
59 | R_PAREN@[65; 66) | ||
60 | WHITESPACE@[66; 67) | ||
61 | BLOCK@[67; 69) | ||
62 | L_CURLY@[67; 68) | ||
63 | R_CURLY@[68; 69) | ||
64 | WHITESPACE@[69; 74) | ||
65 | FN_DEF@[74; 103) | ||
66 | FN_KW@[74; 76) | ||
67 | WHITESPACE@[76; 77) | ||
68 | NAME@[77; 78) | ||
69 | IDENT@[77; 78) "d" | ||
70 | PARAM_LIST@[78; 100) | ||
71 | L_PAREN@[78; 79) | ||
72 | SELF_PARAM@[79; 91) | ||
73 | AMP@[79; 80) | ||
74 | LIFETIME@[80; 82) "'a" | ||
75 | WHITESPACE@[82; 83) | ||
76 | MUT_KW@[83; 86) | ||
77 | WHITESPACE@[86; 87) | ||
78 | SELF_KW@[87; 91) | ||
79 | COMMA@[91; 92) | ||
80 | WHITESPACE@[92; 93) | ||
81 | PARAM@[93; 99) | ||
82 | BIND_PAT@[93; 94) | ||
83 | NAME@[93; 94) | ||
84 | IDENT@[93; 94) "x" | ||
85 | COLON@[94; 95) | ||
86 | WHITESPACE@[95; 96) | ||
87 | PATH_TYPE@[96; 99) | ||
88 | PATH@[96; 99) | ||
89 | PATH_SEGMENT@[96; 99) | ||
90 | NAME_REF@[96; 99) | ||
91 | IDENT@[96; 99) "i32" | ||
92 | R_PAREN@[99; 100) | ||
93 | WHITESPACE@[100; 101) | ||
94 | BLOCK@[101; 103) | ||
95 | L_CURLY@[101; 102) | ||
96 | R_CURLY@[102; 103) | ||
97 | WHITESPACE@[103; 108) | ||
98 | FN_DEF@[108; 125) | ||
99 | FN_KW@[108; 110) | ||
100 | WHITESPACE@[110; 111) | ||
101 | NAME@[111; 112) | ||
102 | IDENT@[111; 112) "e" | ||
103 | PARAM_LIST@[112; 122) | ||
104 | L_PAREN@[112; 113) | ||
105 | SELF_PARAM@[113; 121) | ||
106 | MUT_KW@[113; 116) | ||
107 | WHITESPACE@[116; 117) | ||
108 | SELF_KW@[117; 121) | ||
109 | R_PAREN@[121; 122) | ||
110 | WHITESPACE@[122; 123) | ||
111 | BLOCK@[123; 125) | ||
112 | L_CURLY@[123; 124) | ||
113 | R_CURLY@[124; 125) | ||
114 | WHITESPACE@[125; 126) | ||
115 | R_CURLY@[126; 127) | ||
116 | WHITESPACE@[127; 128) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0007_type_param_bounds.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0007_type_param_bounds.rs new file mode 100644 index 000000000..919bde0ee --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0007_type_param_bounds.rs | |||
@@ -0,0 +1 @@ | |||
struct S<T: 'a + ?Sized + (Copy)>; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0007_type_param_bounds.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0007_type_param_bounds.txt new file mode 100644 index 000000000..745cf8798 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0007_type_param_bounds.txt | |||
@@ -0,0 +1,36 @@ | |||
1 | SOURCE_FILE@[0; 35) | ||
2 | STRUCT_DEF@[0; 34) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | TYPE_PARAM_LIST@[8; 33) | ||
8 | L_ANGLE@[8; 9) | ||
9 | TYPE_PARAM@[9; 32) | ||
10 | NAME@[9; 10) | ||
11 | IDENT@[9; 10) "T" | ||
12 | COLON@[10; 11) | ||
13 | WHITESPACE@[11; 12) | ||
14 | LIFETIME@[12; 14) "'a" | ||
15 | WHITESPACE@[14; 15) | ||
16 | PLUS@[15; 16) | ||
17 | WHITESPACE@[16; 17) | ||
18 | QUESTION@[17; 18) | ||
19 | PATH_TYPE@[18; 32) | ||
20 | PATH@[18; 23) | ||
21 | PATH_SEGMENT@[18; 23) | ||
22 | NAME_REF@[18; 23) | ||
23 | IDENT@[18; 23) "Sized" | ||
24 | WHITESPACE@[23; 24) | ||
25 | PLUS@[24; 25) | ||
26 | WHITESPACE@[25; 26) | ||
27 | L_PAREN@[26; 27) | ||
28 | PATH_TYPE@[27; 31) | ||
29 | PATH@[27; 31) | ||
30 | PATH_SEGMENT@[27; 31) | ||
31 | NAME_REF@[27; 31) | ||
32 | IDENT@[27; 31) "Copy" | ||
33 | R_PAREN@[31; 32) | ||
34 | R_ANGLE@[32; 33) | ||
35 | SEMI@[33; 34) | ||
36 | WHITESPACE@[34; 35) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0008_path_part.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0008_path_part.rs new file mode 100644 index 000000000..f6e32c7c1 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0008_path_part.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let foo::Bar = (); | ||
3 | let ::Bar = (); | ||
4 | let Bar { .. } = (); | ||
5 | let Bar(..) = (); | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0008_path_part.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0008_path_part.txt new file mode 100644 index 000000000..0020cfb4d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0008_path_part.txt | |||
@@ -0,0 +1,95 @@ | |||
1 | SOURCE_FILE@[0; 103) | ||
2 | FN_DEF@[0; 102) | ||
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@[9; 102) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 33) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PATH_PAT@[19; 27) | ||
18 | PATH@[19; 27) | ||
19 | PATH@[19; 22) | ||
20 | PATH_SEGMENT@[19; 22) | ||
21 | NAME_REF@[19; 22) | ||
22 | IDENT@[19; 22) "foo" | ||
23 | COLONCOLON@[22; 24) | ||
24 | PATH_SEGMENT@[24; 27) | ||
25 | NAME_REF@[24; 27) | ||
26 | IDENT@[24; 27) "Bar" | ||
27 | WHITESPACE@[27; 28) | ||
28 | EQ@[28; 29) | ||
29 | WHITESPACE@[29; 30) | ||
30 | TUPLE_EXPR@[30; 32) | ||
31 | L_PAREN@[30; 31) | ||
32 | R_PAREN@[31; 32) | ||
33 | SEMI@[32; 33) | ||
34 | WHITESPACE@[33; 38) | ||
35 | LET_STMT@[38; 53) | ||
36 | LET_KW@[38; 41) | ||
37 | WHITESPACE@[41; 42) | ||
38 | PATH_PAT@[42; 47) | ||
39 | PATH@[42; 47) | ||
40 | PATH_SEGMENT@[42; 47) | ||
41 | COLONCOLON@[42; 44) | ||
42 | NAME_REF@[44; 47) | ||
43 | IDENT@[44; 47) "Bar" | ||
44 | WHITESPACE@[47; 48) | ||
45 | EQ@[48; 49) | ||
46 | WHITESPACE@[49; 50) | ||
47 | TUPLE_EXPR@[50; 52) | ||
48 | L_PAREN@[50; 51) | ||
49 | R_PAREN@[51; 52) | ||
50 | SEMI@[52; 53) | ||
51 | WHITESPACE@[53; 58) | ||
52 | LET_STMT@[58; 78) | ||
53 | LET_KW@[58; 61) | ||
54 | WHITESPACE@[61; 62) | ||
55 | STRUCT_PAT@[62; 72) | ||
56 | PATH@[62; 65) | ||
57 | PATH_SEGMENT@[62; 65) | ||
58 | NAME_REF@[62; 65) | ||
59 | IDENT@[62; 65) "Bar" | ||
60 | WHITESPACE@[65; 66) | ||
61 | FIELD_PAT_LIST@[66; 72) | ||
62 | L_CURLY@[66; 67) | ||
63 | WHITESPACE@[67; 68) | ||
64 | DOTDOT@[68; 70) | ||
65 | WHITESPACE@[70; 71) | ||
66 | R_CURLY@[71; 72) | ||
67 | WHITESPACE@[72; 73) | ||
68 | EQ@[73; 74) | ||
69 | WHITESPACE@[74; 75) | ||
70 | TUPLE_EXPR@[75; 77) | ||
71 | L_PAREN@[75; 76) | ||
72 | R_PAREN@[76; 77) | ||
73 | SEMI@[77; 78) | ||
74 | WHITESPACE@[78; 83) | ||
75 | LET_STMT@[83; 100) | ||
76 | LET_KW@[83; 86) | ||
77 | WHITESPACE@[86; 87) | ||
78 | TUPLE_STRUCT_PAT@[87; 94) | ||
79 | PATH@[87; 90) | ||
80 | PATH_SEGMENT@[87; 90) | ||
81 | NAME_REF@[87; 90) | ||
82 | IDENT@[87; 90) "Bar" | ||
83 | L_PAREN@[90; 91) | ||
84 | DOTDOT@[91; 93) | ||
85 | R_PAREN@[93; 94) | ||
86 | WHITESPACE@[94; 95) | ||
87 | EQ@[95; 96) | ||
88 | WHITESPACE@[96; 97) | ||
89 | TUPLE_EXPR@[97; 99) | ||
90 | L_PAREN@[97; 98) | ||
91 | R_PAREN@[98; 99) | ||
92 | SEMI@[99; 100) | ||
93 | WHITESPACE@[100; 101) | ||
94 | R_CURLY@[101; 102) | ||
95 | WHITESPACE@[102; 103) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0009_loop_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0009_loop_expr.rs new file mode 100644 index 000000000..9f078fa48 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0009_loop_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | loop {}; | ||
3 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0009_loop_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0009_loop_expr.txt new file mode 100644 index 000000000..c3c64c322 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0009_loop_expr.txt | |||
@@ -0,0 +1,24 @@ | |||
1 | SOURCE_FILE@[0; 26) | ||
2 | FN_DEF@[0; 25) | ||
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@[9; 25) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 23) | ||
15 | LOOP_EXPR@[15; 22) | ||
16 | LOOP_KW@[15; 19) | ||
17 | WHITESPACE@[19; 20) | ||
18 | BLOCK@[20; 22) | ||
19 | L_CURLY@[20; 21) | ||
20 | R_CURLY@[21; 22) | ||
21 | SEMI@[22; 23) | ||
22 | WHITESPACE@[23; 24) | ||
23 | R_CURLY@[24; 25) | ||
24 | WHITESPACE@[25; 26) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0010_extern_block.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0010_extern_block.rs new file mode 100644 index 000000000..26a9ccd1e --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0010_extern_block.rs | |||
@@ -0,0 +1 @@ | |||
extern {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0010_extern_block.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0010_extern_block.txt new file mode 100644 index 000000000..7e79c2280 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0010_extern_block.txt | |||
@@ -0,0 +1,9 @@ | |||
1 | SOURCE_FILE@[0; 10) | ||
2 | EXTERN_BLOCK@[0; 9) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) | ||
5 | WHITESPACE@[6; 7) | ||
6 | EXTERN_ITEM_LIST@[7; 9) | ||
7 | L_CURLY@[7; 8) | ||
8 | R_CURLY@[8; 9) | ||
9 | WHITESPACE@[9; 10) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0011_field_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0011_field_expr.rs new file mode 100644 index 000000000..3e69538e5 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0011_field_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | x.foo; | ||
3 | x.0.bar; | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0011_field_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0011_field_expr.txt new file mode 100644 index 000000000..03fbf092b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0011_field_expr.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | SOURCE_FILE@[0; 37) | ||
2 | FN_DEF@[0; 36) | ||
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@[9; 36) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 21) | ||
15 | FIELD_EXPR@[15; 20) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | DOT@[16; 17) | ||
22 | NAME_REF@[17; 20) | ||
23 | IDENT@[17; 20) "foo" | ||
24 | SEMI@[20; 21) | ||
25 | WHITESPACE@[21; 26) | ||
26 | EXPR_STMT@[26; 34) | ||
27 | FIELD_EXPR@[26; 33) | ||
28 | FIELD_EXPR@[26; 29) | ||
29 | PATH_EXPR@[26; 27) | ||
30 | PATH@[26; 27) | ||
31 | PATH_SEGMENT@[26; 27) | ||
32 | NAME_REF@[26; 27) | ||
33 | IDENT@[26; 27) "x" | ||
34 | DOT@[27; 28) | ||
35 | INT_NUMBER@[28; 29) "0" | ||
36 | DOT@[29; 30) | ||
37 | NAME_REF@[30; 33) | ||
38 | IDENT@[30; 33) "bar" | ||
39 | SEMI@[33; 34) | ||
40 | WHITESPACE@[34; 35) | ||
41 | R_CURLY@[35; 36) | ||
42 | WHITESPACE@[36; 37) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.rs new file mode 100644 index 000000000..a602d07f0 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.rs | |||
@@ -0,0 +1 @@ | |||
type Foo where Foo: Copy = (); | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.txt new file mode 100644 index 000000000..dbb705acf --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | SOURCE_FILE@[0; 31) | ||
2 | TYPE_DEF@[0; 30) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 8) | ||
6 | IDENT@[5; 8) "Foo" | ||
7 | WHITESPACE@[8; 9) | ||
8 | WHERE_CLAUSE@[9; 24) | ||
9 | WHERE_KW@[9; 14) | ||
10 | WHITESPACE@[14; 15) | ||
11 | WHERE_PRED@[15; 24) | ||
12 | PATH_TYPE@[15; 18) | ||
13 | PATH@[15; 18) | ||
14 | PATH_SEGMENT@[15; 18) | ||
15 | NAME_REF@[15; 18) | ||
16 | IDENT@[15; 18) "Foo" | ||
17 | COLON@[18; 19) | ||
18 | WHITESPACE@[19; 20) | ||
19 | PATH_TYPE@[20; 24) | ||
20 | PATH@[20; 24) | ||
21 | PATH_SEGMENT@[20; 24) | ||
22 | NAME_REF@[20; 24) | ||
23 | IDENT@[20; 24) "Copy" | ||
24 | WHITESPACE@[24; 25) | ||
25 | EQ@[25; 26) | ||
26 | WHITESPACE@[26; 27) | ||
27 | TUPLE_TYPE@[27; 29) | ||
28 | L_PAREN@[27; 28) | ||
29 | R_PAREN@[28; 29) | ||
30 | SEMI@[29; 30) | ||
31 | WHITESPACE@[30; 31) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.rs new file mode 100644 index 000000000..04b2bb9ba --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | type M = *mut (); | ||
2 | type C = *mut (); | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.txt new file mode 100644 index 000000000..149cd571d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | SOURCE_FILE@[0; 36) | ||
2 | TYPE_DEF@[0; 17) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "M" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | POINTER_TYPE@[9; 16) | ||
11 | STAR@[9; 10) | ||
12 | MUT_KW@[10; 13) | ||
13 | WHITESPACE@[13; 14) | ||
14 | TUPLE_TYPE@[14; 16) | ||
15 | L_PAREN@[14; 15) | ||
16 | R_PAREN@[15; 16) | ||
17 | SEMI@[16; 17) | ||
18 | WHITESPACE@[17; 18) | ||
19 | TYPE_DEF@[18; 35) | ||
20 | TYPE_KW@[18; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | NAME@[23; 24) | ||
23 | IDENT@[23; 24) "C" | ||
24 | WHITESPACE@[24; 25) | ||
25 | EQ@[25; 26) | ||
26 | WHITESPACE@[26; 27) | ||
27 | POINTER_TYPE@[27; 34) | ||
28 | STAR@[27; 28) | ||
29 | MUT_KW@[28; 31) | ||
30 | WHITESPACE@[31; 32) | ||
31 | TUPLE_TYPE@[32; 34) | ||
32 | L_PAREN@[32; 33) | ||
33 | R_PAREN@[33; 34) | ||
34 | SEMI@[34; 35) | ||
35 | WHITESPACE@[35; 36) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.rs new file mode 100644 index 000000000..de399fcf4 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.rs | |||
@@ -0,0 +1 @@ | |||
type Never = !; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.txt new file mode 100644 index 000000000..e0cae644d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | SOURCE_FILE@[0; 16) | ||
2 | TYPE_DEF@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 10) | ||
6 | IDENT@[5; 10) "Never" | ||
7 | WHITESPACE@[10; 11) | ||
8 | EQ@[11; 12) | ||
9 | WHITESPACE@[12; 13) | ||
10 | NEVER_TYPE@[13; 14) | ||
11 | EXCL@[13; 14) | ||
12 | SEMI@[14; 15) | ||
13 | WHITESPACE@[15; 16) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0015_continue_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0015_continue_expr.rs new file mode 100644 index 000000000..474cc3f0e --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0015_continue_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | loop { | ||
3 | continue; | ||
4 | continue 'l; | ||
5 | } | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0015_continue_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0015_continue_expr.txt new file mode 100644 index 000000000..39be5b2c8 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0015_continue_expr.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | SOURCE_FILE@[0; 69) | ||
2 | FN_DEF@[0; 68) | ||
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@[9; 68) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LOOP_EXPR@[15; 66) | ||
15 | LOOP_KW@[15; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | BLOCK@[20; 66) | ||
18 | L_CURLY@[20; 21) | ||
19 | WHITESPACE@[21; 30) | ||
20 | EXPR_STMT@[30; 39) | ||
21 | CONTINUE_EXPR@[30; 38) | ||
22 | CONTINUE_KW@[30; 38) | ||
23 | SEMI@[38; 39) | ||
24 | WHITESPACE@[39; 48) | ||
25 | EXPR_STMT@[48; 60) | ||
26 | CONTINUE_EXPR@[48; 59) | ||
27 | CONTINUE_KW@[48; 56) | ||
28 | WHITESPACE@[56; 57) | ||
29 | LIFETIME@[57; 59) "'l" | ||
30 | SEMI@[59; 60) | ||
31 | WHITESPACE@[60; 65) | ||
32 | R_CURLY@[65; 66) | ||
33 | WHITESPACE@[66; 67) | ||
34 | R_CURLY@[67; 68) | ||
35 | WHITESPACE@[68; 69) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0016_unsafe_trait.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0016_unsafe_trait.rs new file mode 100644 index 000000000..04e021550 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0016_unsafe_trait.rs | |||
@@ -0,0 +1 @@ | |||
unsafe trait T {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0016_unsafe_trait.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0016_unsafe_trait.txt new file mode 100644 index 000000000..3669c93a8 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0016_unsafe_trait.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | SOURCE_FILE@[0; 18) | ||
2 | TRAIT_DEF@[0; 17) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | TRAIT_KW@[7; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | NAME@[13; 14) | ||
8 | IDENT@[13; 14) "T" | ||
9 | WHITESPACE@[14; 15) | ||
10 | ITEM_LIST@[15; 17) | ||
11 | L_CURLY@[15; 16) | ||
12 | R_CURLY@[16; 17) | ||
13 | WHITESPACE@[17; 18) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.rs new file mode 100644 index 000000000..27eb22f22 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = [(); 92]; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.txt new file mode 100644 index 000000000..2c2b615fc --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | SOURCE_FILE@[0; 19) | ||
2 | TYPE_DEF@[0; 18) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | ARRAY_TYPE@[9; 17) | ||
11 | L_BRACK@[9; 10) | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) | ||
14 | R_PAREN@[11; 12) | ||
15 | SEMI@[12; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | LITERAL@[14; 16) | ||
18 | INT_NUMBER@[14; 16) "92" | ||
19 | R_BRACK@[16; 17) | ||
20 | SEMI@[17; 18) | ||
21 | WHITESPACE@[18; 19) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0018_arb_self_types.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0018_arb_self_types.rs new file mode 100644 index 000000000..6a170d5ac --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0018_arb_self_types.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | impl S { | ||
2 | fn a(self: &Self) {} | ||
3 | fn b(mut self: Box<Self>) {} | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0018_arb_self_types.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0018_arb_self_types.txt new file mode 100644 index 000000000..b2f04ea7b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0018_arb_self_types.txt | |||
@@ -0,0 +1,72 @@ | |||
1 | SOURCE_FILE@[0; 69) | ||
2 | IMPL_ITEM@[0; 68) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "S" | ||
10 | WHITESPACE@[6; 7) | ||
11 | ITEM_LIST@[7; 68) | ||
12 | L_CURLY@[7; 8) | ||
13 | WHITESPACE@[8; 13) | ||
14 | FN_DEF@[13; 33) | ||
15 | FN_KW@[13; 15) | ||
16 | WHITESPACE@[15; 16) | ||
17 | NAME@[16; 17) | ||
18 | IDENT@[16; 17) "a" | ||
19 | PARAM_LIST@[17; 30) | ||
20 | L_PAREN@[17; 18) | ||
21 | SELF_PARAM@[18; 29) | ||
22 | SELF_KW@[18; 22) | ||
23 | COLON@[22; 23) | ||
24 | WHITESPACE@[23; 24) | ||
25 | REFERENCE_TYPE@[24; 29) | ||
26 | AMP@[24; 25) | ||
27 | PATH_TYPE@[25; 29) | ||
28 | PATH@[25; 29) | ||
29 | PATH_SEGMENT@[25; 29) | ||
30 | NAME_REF@[25; 29) | ||
31 | IDENT@[25; 29) "Self" | ||
32 | R_PAREN@[29; 30) | ||
33 | WHITESPACE@[30; 31) | ||
34 | BLOCK@[31; 33) | ||
35 | L_CURLY@[31; 32) | ||
36 | R_CURLY@[32; 33) | ||
37 | WHITESPACE@[33; 38) | ||
38 | FN_DEF@[38; 66) | ||
39 | FN_KW@[38; 40) | ||
40 | WHITESPACE@[40; 41) | ||
41 | NAME@[41; 42) | ||
42 | IDENT@[41; 42) "b" | ||
43 | PARAM_LIST@[42; 63) | ||
44 | L_PAREN@[42; 43) | ||
45 | SELF_PARAM@[43; 62) | ||
46 | MUT_KW@[43; 46) | ||
47 | WHITESPACE@[46; 47) | ||
48 | SELF_KW@[47; 51) | ||
49 | COLON@[51; 52) | ||
50 | WHITESPACE@[52; 53) | ||
51 | PATH_TYPE@[53; 62) | ||
52 | PATH@[53; 62) | ||
53 | PATH_SEGMENT@[53; 62) | ||
54 | NAME_REF@[53; 56) | ||
55 | IDENT@[53; 56) "Box" | ||
56 | TYPE_ARG_LIST@[56; 62) | ||
57 | L_ANGLE@[56; 57) | ||
58 | TYPE_ARG@[57; 61) | ||
59 | PATH_TYPE@[57; 61) | ||
60 | PATH@[57; 61) | ||
61 | PATH_SEGMENT@[57; 61) | ||
62 | NAME_REF@[57; 61) | ||
63 | IDENT@[57; 61) "Self" | ||
64 | R_ANGLE@[61; 62) | ||
65 | R_PAREN@[62; 63) | ||
66 | WHITESPACE@[63; 64) | ||
67 | BLOCK@[64; 66) | ||
68 | L_CURLY@[64; 65) | ||
69 | R_CURLY@[65; 66) | ||
70 | WHITESPACE@[66; 67) | ||
71 | R_CURLY@[67; 68) | ||
72 | WHITESPACE@[68; 69) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0019_unary_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0019_unary_expr.rs new file mode 100644 index 000000000..f1c3f7118 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0019_unary_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | **&1; | ||
3 | !!true; | ||
4 | --1; | ||
5 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0019_unary_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0019_unary_expr.txt new file mode 100644 index 000000000..72d7d8bfb --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0019_unary_expr.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | SOURCE_FILE@[0; 44) | ||
2 | FN_DEF@[0; 43) | ||
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@[9; 43) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 20) | ||
15 | PREFIX_EXPR@[15; 19) | ||
16 | STAR@[15; 16) | ||
17 | PREFIX_EXPR@[16; 19) | ||
18 | STAR@[16; 17) | ||
19 | REF_EXPR@[17; 19) | ||
20 | AMP@[17; 18) | ||
21 | LITERAL@[18; 19) | ||
22 | INT_NUMBER@[18; 19) "1" | ||
23 | SEMI@[19; 20) | ||
24 | WHITESPACE@[20; 25) | ||
25 | EXPR_STMT@[25; 32) | ||
26 | PREFIX_EXPR@[25; 31) | ||
27 | EXCL@[25; 26) | ||
28 | PREFIX_EXPR@[26; 31) | ||
29 | EXCL@[26; 27) | ||
30 | LITERAL@[27; 31) | ||
31 | TRUE_KW@[27; 31) | ||
32 | SEMI@[31; 32) | ||
33 | WHITESPACE@[32; 37) | ||
34 | EXPR_STMT@[37; 41) | ||
35 | PREFIX_EXPR@[37; 40) | ||
36 | MINUS@[37; 38) | ||
37 | PREFIX_EXPR@[38; 40) | ||
38 | MINUS@[38; 39) | ||
39 | LITERAL@[39; 40) | ||
40 | INT_NUMBER@[39; 40) "1" | ||
41 | SEMI@[40; 41) | ||
42 | WHITESPACE@[41; 42) | ||
43 | R_CURLY@[42; 43) | ||
44 | WHITESPACE@[43; 44) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0020_use_star.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0020_use_star.rs new file mode 100644 index 000000000..6f15769a8 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0020_use_star.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | use *; | ||
2 | use ::*; | ||
3 | use some::path::{*}; | ||
4 | use some::path::{::*}; | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0020_use_star.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0020_use_star.txt new file mode 100644 index 000000000..2db3cbf9e --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0020_use_star.txt | |||
@@ -0,0 +1,59 @@ | |||
1 | SOURCE_FILE@[0; 60) | ||
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; 36) | ||
18 | USE_KW@[16; 19) | ||
19 | WHITESPACE@[19; 20) | ||
20 | USE_TREE@[20; 35) | ||
21 | PATH@[20; 30) | ||
22 | PATH@[20; 24) | ||
23 | PATH_SEGMENT@[20; 24) | ||
24 | NAME_REF@[20; 24) | ||
25 | IDENT@[20; 24) "some" | ||
26 | COLONCOLON@[24; 26) | ||
27 | PATH_SEGMENT@[26; 30) | ||
28 | NAME_REF@[26; 30) | ||
29 | IDENT@[26; 30) "path" | ||
30 | COLONCOLON@[30; 32) | ||
31 | USE_TREE_LIST@[32; 35) | ||
32 | L_CURLY@[32; 33) | ||
33 | USE_TREE@[33; 34) | ||
34 | STAR@[33; 34) | ||
35 | R_CURLY@[34; 35) | ||
36 | SEMI@[35; 36) | ||
37 | WHITESPACE@[36; 37) | ||
38 | USE_ITEM@[37; 59) | ||
39 | USE_KW@[37; 40) | ||
40 | WHITESPACE@[40; 41) | ||
41 | USE_TREE@[41; 58) | ||
42 | PATH@[41; 51) | ||
43 | PATH@[41; 45) | ||
44 | PATH_SEGMENT@[41; 45) | ||
45 | NAME_REF@[41; 45) | ||
46 | IDENT@[41; 45) "some" | ||
47 | COLONCOLON@[45; 47) | ||
48 | PATH_SEGMENT@[47; 51) | ||
49 | NAME_REF@[47; 51) | ||
50 | IDENT@[47; 51) "path" | ||
51 | COLONCOLON@[51; 53) | ||
52 | USE_TREE_LIST@[53; 58) | ||
53 | L_CURLY@[53; 54) | ||
54 | USE_TREE@[54; 57) | ||
55 | COLONCOLON@[54; 56) | ||
56 | STAR@[56; 57) | ||
57 | R_CURLY@[57; 58) | ||
58 | SEMI@[58; 59) | ||
59 | WHITESPACE@[59; 60) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.rs new file mode 100644 index 000000000..f10851487 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | impl F { | ||
2 | type A = i32; | ||
3 | const B: i32 = 92; | ||
4 | fn foo() {} | ||
5 | fn bar(&self) {} | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.txt new file mode 100644 index 000000000..b15f93cd2 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.txt | |||
@@ -0,0 +1,78 @@ | |||
1 | SOURCE_FILE@[0; 89) | ||
2 | IMPL_ITEM@[0; 88) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "F" | ||
10 | WHITESPACE@[6; 7) | ||
11 | ITEM_LIST@[7; 88) | ||
12 | L_CURLY@[7; 8) | ||
13 | WHITESPACE@[8; 13) | ||
14 | TYPE_DEF@[13; 26) | ||
15 | TYPE_KW@[13; 17) | ||
16 | WHITESPACE@[17; 18) | ||
17 | NAME@[18; 19) | ||
18 | IDENT@[18; 19) "A" | ||
19 | WHITESPACE@[19; 20) | ||
20 | EQ@[20; 21) | ||
21 | WHITESPACE@[21; 22) | ||
22 | PATH_TYPE@[22; 25) | ||
23 | PATH@[22; 25) | ||
24 | PATH_SEGMENT@[22; 25) | ||
25 | NAME_REF@[22; 25) | ||
26 | IDENT@[22; 25) "i32" | ||
27 | SEMI@[25; 26) | ||
28 | WHITESPACE@[26; 31) | ||
29 | CONST_DEF@[31; 49) | ||
30 | CONST_KW@[31; 36) | ||
31 | WHITESPACE@[36; 37) | ||
32 | NAME@[37; 38) | ||
33 | IDENT@[37; 38) "B" | ||
34 | COLON@[38; 39) | ||
35 | WHITESPACE@[39; 40) | ||
36 | PATH_TYPE@[40; 43) | ||
37 | PATH@[40; 43) | ||
38 | PATH_SEGMENT@[40; 43) | ||
39 | NAME_REF@[40; 43) | ||
40 | IDENT@[40; 43) "i32" | ||
41 | WHITESPACE@[43; 44) | ||
42 | EQ@[44; 45) | ||
43 | WHITESPACE@[45; 46) | ||
44 | LITERAL@[46; 48) | ||
45 | INT_NUMBER@[46; 48) "92" | ||
46 | SEMI@[48; 49) | ||
47 | WHITESPACE@[49; 54) | ||
48 | FN_DEF@[54; 65) | ||
49 | FN_KW@[54; 56) | ||
50 | WHITESPACE@[56; 57) | ||
51 | NAME@[57; 60) | ||
52 | IDENT@[57; 60) "foo" | ||
53 | PARAM_LIST@[60; 62) | ||
54 | L_PAREN@[60; 61) | ||
55 | R_PAREN@[61; 62) | ||
56 | WHITESPACE@[62; 63) | ||
57 | BLOCK@[63; 65) | ||
58 | L_CURLY@[63; 64) | ||
59 | R_CURLY@[64; 65) | ||
60 | WHITESPACE@[65; 70) | ||
61 | FN_DEF@[70; 86) | ||
62 | FN_KW@[70; 72) | ||
63 | WHITESPACE@[72; 73) | ||
64 | NAME@[73; 76) | ||
65 | IDENT@[73; 76) "bar" | ||
66 | PARAM_LIST@[76; 83) | ||
67 | L_PAREN@[76; 77) | ||
68 | SELF_PARAM@[77; 82) | ||
69 | AMP@[77; 78) | ||
70 | SELF_KW@[78; 82) | ||
71 | R_PAREN@[82; 83) | ||
72 | WHITESPACE@[83; 84) | ||
73 | BLOCK@[84; 86) | ||
74 | L_CURLY@[84; 85) | ||
75 | R_CURLY@[85; 86) | ||
76 | WHITESPACE@[86; 87) | ||
77 | R_CURLY@[87; 88) | ||
78 | WHITESPACE@[88; 89) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0022_crate_visibility.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0022_crate_visibility.rs new file mode 100644 index 000000000..faeefde94 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0022_crate_visibility.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | pub(crate) struct S; | ||
2 | pub(self) struct S; | ||
3 | pub(self) struct S; | ||
4 | pub(self) struct S; | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0022_crate_visibility.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0022_crate_visibility.txt new file mode 100644 index 000000000..7d137cfe9 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0022_crate_visibility.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | SOURCE_FILE@[0; 81) | ||
2 | STRUCT_DEF@[0; 20) | ||
3 | VISIBILITY@[0; 10) | ||
4 | PUB_KW@[0; 3) | ||
5 | L_PAREN@[3; 4) | ||
6 | CRATE_KW@[4; 9) | ||
7 | R_PAREN@[9; 10) | ||
8 | WHITESPACE@[10; 11) | ||
9 | STRUCT_KW@[11; 17) | ||
10 | WHITESPACE@[17; 18) | ||
11 | NAME@[18; 19) | ||
12 | IDENT@[18; 19) "S" | ||
13 | SEMI@[19; 20) | ||
14 | WHITESPACE@[20; 21) | ||
15 | STRUCT_DEF@[21; 40) | ||
16 | VISIBILITY@[21; 30) | ||
17 | PUB_KW@[21; 24) | ||
18 | L_PAREN@[24; 25) | ||
19 | SELF_KW@[25; 29) | ||
20 | R_PAREN@[29; 30) | ||
21 | WHITESPACE@[30; 31) | ||
22 | STRUCT_KW@[31; 37) | ||
23 | WHITESPACE@[37; 38) | ||
24 | NAME@[38; 39) | ||
25 | IDENT@[38; 39) "S" | ||
26 | SEMI@[39; 40) | ||
27 | WHITESPACE@[40; 41) | ||
28 | STRUCT_DEF@[41; 60) | ||
29 | VISIBILITY@[41; 50) | ||
30 | PUB_KW@[41; 44) | ||
31 | L_PAREN@[44; 45) | ||
32 | SELF_KW@[45; 49) | ||
33 | R_PAREN@[49; 50) | ||
34 | WHITESPACE@[50; 51) | ||
35 | STRUCT_KW@[51; 57) | ||
36 | WHITESPACE@[57; 58) | ||
37 | NAME@[58; 59) | ||
38 | IDENT@[58; 59) "S" | ||
39 | SEMI@[59; 60) | ||
40 | WHITESPACE@[60; 61) | ||
41 | STRUCT_DEF@[61; 80) | ||
42 | VISIBILITY@[61; 70) | ||
43 | PUB_KW@[61; 64) | ||
44 | L_PAREN@[64; 65) | ||
45 | SELF_KW@[65; 69) | ||
46 | R_PAREN@[69; 70) | ||
47 | WHITESPACE@[70; 71) | ||
48 | STRUCT_KW@[71; 77) | ||
49 | WHITESPACE@[77; 78) | ||
50 | NAME@[78; 79) | ||
51 | IDENT@[78; 79) "S" | ||
52 | SEMI@[79; 80) | ||
53 | WHITESPACE@[80; 81) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.rs new file mode 100644 index 000000000..7952dbd57 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.rs | |||
@@ -0,0 +1 @@ | |||
type Placeholder = _; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.txt new file mode 100644 index 000000000..43ada95d4 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | SOURCE_FILE@[0; 22) | ||
2 | TYPE_DEF@[0; 21) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 16) | ||
6 | IDENT@[5; 16) "Placeholder" | ||
7 | WHITESPACE@[16; 17) | ||
8 | EQ@[17; 18) | ||
9 | WHITESPACE@[18; 19) | ||
10 | PLACEHOLDER_TYPE@[19; 20) | ||
11 | UNDERSCORE@[19; 20) | ||
12 | SEMI@[20; 21) | ||
13 | WHITESPACE@[21; 22) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0024_slice_pat.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0024_slice_pat.rs new file mode 100644 index 000000000..7955973b9 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0024_slice_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | let [a, b, ..] = []; | ||
3 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0024_slice_pat.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0024_slice_pat.txt new file mode 100644 index 000000000..72987308d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0024_slice_pat.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | SOURCE_FILE@[0; 39) | ||
2 | FN_DEF@[0; 38) | ||
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@[10; 38) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 36) | ||
15 | LET_KW@[16; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | SLICE_PAT@[20; 30) | ||
18 | L_BRACK@[20; 21) | ||
19 | BIND_PAT@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "a" | ||
22 | COMMA@[22; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | BIND_PAT@[24; 25) | ||
25 | NAME@[24; 25) | ||
26 | IDENT@[24; 25) "b" | ||
27 | COMMA@[25; 26) | ||
28 | WHITESPACE@[26; 27) | ||
29 | DOTDOT@[27; 29) | ||
30 | R_BRACK@[29; 30) | ||
31 | WHITESPACE@[30; 31) | ||
32 | EQ@[31; 32) | ||
33 | WHITESPACE@[32; 33) | ||
34 | ARRAY_EXPR@[33; 35) | ||
35 | L_BRACK@[33; 34) | ||
36 | R_BRACK@[34; 35) | ||
37 | SEMI@[35; 36) | ||
38 | WHITESPACE@[36; 37) | ||
39 | R_CURLY@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.rs new file mode 100644 index 000000000..4da1af827 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = [()]; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.txt new file mode 100644 index 000000000..db18c7139 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | SOURCE_FILE@[0; 15) | ||
2 | TYPE_DEF@[0; 14) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | SLICE_TYPE@[9; 13) | ||
11 | L_BRACK@[9; 10) | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) | ||
14 | R_PAREN@[11; 12) | ||
15 | R_BRACK@[12; 13) | ||
16 | SEMI@[13; 14) | ||
17 | WHITESPACE@[14; 15) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0026_tuple_pat_fields.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0026_tuple_pat_fields.rs new file mode 100644 index 000000000..0dfe63629 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0026_tuple_pat_fields.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let S() = (); | ||
3 | let S(_) = (); | ||
4 | let S(_,) = (); | ||
5 | let S(_, .. , x) = (); | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0026_tuple_pat_fields.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0026_tuple_pat_fields.txt new file mode 100644 index 000000000..737fbec22 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0026_tuple_pat_fields.txt | |||
@@ -0,0 +1,103 @@ | |||
1 | SOURCE_FILE@[0; 97) | ||
2 | FN_DEF@[0; 96) | ||
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@[9; 96) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 28) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | TUPLE_STRUCT_PAT@[19; 22) | ||
18 | PATH@[19; 20) | ||
19 | PATH_SEGMENT@[19; 20) | ||
20 | NAME_REF@[19; 20) | ||
21 | IDENT@[19; 20) "S" | ||
22 | L_PAREN@[20; 21) | ||
23 | R_PAREN@[21; 22) | ||
24 | WHITESPACE@[22; 23) | ||
25 | EQ@[23; 24) | ||
26 | WHITESPACE@[24; 25) | ||
27 | TUPLE_EXPR@[25; 27) | ||
28 | L_PAREN@[25; 26) | ||
29 | R_PAREN@[26; 27) | ||
30 | SEMI@[27; 28) | ||
31 | WHITESPACE@[28; 33) | ||
32 | LET_STMT@[33; 47) | ||
33 | LET_KW@[33; 36) | ||
34 | WHITESPACE@[36; 37) | ||
35 | TUPLE_STRUCT_PAT@[37; 41) | ||
36 | PATH@[37; 38) | ||
37 | PATH_SEGMENT@[37; 38) | ||
38 | NAME_REF@[37; 38) | ||
39 | IDENT@[37; 38) "S" | ||
40 | L_PAREN@[38; 39) | ||
41 | PLACEHOLDER_PAT@[39; 40) | ||
42 | UNDERSCORE@[39; 40) | ||
43 | R_PAREN@[40; 41) | ||
44 | WHITESPACE@[41; 42) | ||
45 | EQ@[42; 43) | ||
46 | WHITESPACE@[43; 44) | ||
47 | TUPLE_EXPR@[44; 46) | ||
48 | L_PAREN@[44; 45) | ||
49 | R_PAREN@[45; 46) | ||
50 | SEMI@[46; 47) | ||
51 | WHITESPACE@[47; 52) | ||
52 | LET_STMT@[52; 67) | ||
53 | LET_KW@[52; 55) | ||
54 | WHITESPACE@[55; 56) | ||
55 | TUPLE_STRUCT_PAT@[56; 61) | ||
56 | PATH@[56; 57) | ||
57 | PATH_SEGMENT@[56; 57) | ||
58 | NAME_REF@[56; 57) | ||
59 | IDENT@[56; 57) "S" | ||
60 | L_PAREN@[57; 58) | ||
61 | PLACEHOLDER_PAT@[58; 59) | ||
62 | UNDERSCORE@[58; 59) | ||
63 | COMMA@[59; 60) | ||
64 | R_PAREN@[60; 61) | ||
65 | WHITESPACE@[61; 62) | ||
66 | EQ@[62; 63) | ||
67 | WHITESPACE@[63; 64) | ||
68 | TUPLE_EXPR@[64; 66) | ||
69 | L_PAREN@[64; 65) | ||
70 | R_PAREN@[65; 66) | ||
71 | SEMI@[66; 67) | ||
72 | WHITESPACE@[67; 72) | ||
73 | LET_STMT@[72; 94) | ||
74 | LET_KW@[72; 75) | ||
75 | WHITESPACE@[75; 76) | ||
76 | TUPLE_STRUCT_PAT@[76; 88) | ||
77 | PATH@[76; 77) | ||
78 | PATH_SEGMENT@[76; 77) | ||
79 | NAME_REF@[76; 77) | ||
80 | IDENT@[76; 77) "S" | ||
81 | L_PAREN@[77; 78) | ||
82 | PLACEHOLDER_PAT@[78; 79) | ||
83 | UNDERSCORE@[78; 79) | ||
84 | COMMA@[79; 80) | ||
85 | WHITESPACE@[80; 81) | ||
86 | DOTDOT@[81; 83) | ||
87 | WHITESPACE@[83; 84) | ||
88 | COMMA@[84; 85) | ||
89 | WHITESPACE@[85; 86) | ||
90 | BIND_PAT@[86; 87) | ||
91 | NAME@[86; 87) | ||
92 | IDENT@[86; 87) "x" | ||
93 | R_PAREN@[87; 88) | ||
94 | WHITESPACE@[88; 89) | ||
95 | EQ@[89; 90) | ||
96 | WHITESPACE@[90; 91) | ||
97 | TUPLE_EXPR@[91; 93) | ||
98 | L_PAREN@[91; 92) | ||
99 | R_PAREN@[92; 93) | ||
100 | SEMI@[93; 94) | ||
101 | WHITESPACE@[94; 95) | ||
102 | R_CURLY@[95; 96) | ||
103 | WHITESPACE@[96; 97) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0027_ref_pat.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0027_ref_pat.rs new file mode 100644 index 000000000..de41f5cae --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0027_ref_pat.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn main() { | ||
2 | let &a = (); | ||
3 | let &mut b = (); | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0027_ref_pat.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0027_ref_pat.txt new file mode 100644 index 000000000..008f4f159 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0027_ref_pat.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | SOURCE_FILE@[0; 52) | ||
2 | FN_DEF@[0; 51) | ||
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@[10; 51) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 28) | ||
15 | LET_KW@[16; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | REF_PAT@[20; 22) | ||
18 | AMP@[20; 21) | ||
19 | BIND_PAT@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "a" | ||
22 | WHITESPACE@[22; 23) | ||
23 | EQ@[23; 24) | ||
24 | WHITESPACE@[24; 25) | ||
25 | TUPLE_EXPR@[25; 27) | ||
26 | L_PAREN@[25; 26) | ||
27 | R_PAREN@[26; 27) | ||
28 | SEMI@[27; 28) | ||
29 | WHITESPACE@[28; 33) | ||
30 | LET_STMT@[33; 49) | ||
31 | LET_KW@[33; 36) | ||
32 | WHITESPACE@[36; 37) | ||
33 | REF_PAT@[37; 43) | ||
34 | AMP@[37; 38) | ||
35 | MUT_KW@[38; 41) | ||
36 | WHITESPACE@[41; 42) | ||
37 | BIND_PAT@[42; 43) | ||
38 | NAME@[42; 43) | ||
39 | IDENT@[42; 43) "b" | ||
40 | WHITESPACE@[43; 44) | ||
41 | EQ@[44; 45) | ||
42 | WHITESPACE@[45; 46) | ||
43 | TUPLE_EXPR@[46; 48) | ||
44 | L_PAREN@[46; 47) | ||
45 | R_PAREN@[47; 48) | ||
46 | SEMI@[48; 49) | ||
47 | WHITESPACE@[49; 50) | ||
48 | R_CURLY@[50; 51) | ||
49 | WHITESPACE@[51; 52) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.rs new file mode 100644 index 000000000..54c5a7c46 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.rs | |||
@@ -0,0 +1 @@ | |||
type A = impl Iterator<Item=Foo<'a>> + 'a; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.txt new file mode 100644 index 000000000..efd4dd42a --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | SOURCE_FILE@[0; 43) | ||
2 | TYPE_DEF@[0; 42) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | IMPL_TRAIT_TYPE@[9; 41) | ||
11 | IMPL_KW@[9; 13) | ||
12 | WHITESPACE@[13; 14) | ||
13 | PATH_TYPE@[14; 41) | ||
14 | PATH@[14; 36) | ||
15 | PATH_SEGMENT@[14; 36) | ||
16 | NAME_REF@[14; 22) | ||
17 | IDENT@[14; 22) "Iterator" | ||
18 | TYPE_ARG_LIST@[22; 36) | ||
19 | L_ANGLE@[22; 23) | ||
20 | ASSOC_TYPE_ARG@[23; 35) | ||
21 | NAME_REF@[23; 27) | ||
22 | IDENT@[23; 27) "Item" | ||
23 | EQ@[27; 28) | ||
24 | PATH_TYPE@[28; 35) | ||
25 | PATH@[28; 35) | ||
26 | PATH_SEGMENT@[28; 35) | ||
27 | NAME_REF@[28; 31) | ||
28 | IDENT@[28; 31) "Foo" | ||
29 | TYPE_ARG_LIST@[31; 35) | ||
30 | L_ANGLE@[31; 32) | ||
31 | LIFETIME_ARG@[32; 34) | ||
32 | LIFETIME@[32; 34) "'a" | ||
33 | R_ANGLE@[34; 35) | ||
34 | R_ANGLE@[35; 36) | ||
35 | WHITESPACE@[36; 37) | ||
36 | PLUS@[37; 38) | ||
37 | WHITESPACE@[38; 39) | ||
38 | LIFETIME@[39; 41) "'a" | ||
39 | SEMI@[41; 42) | ||
40 | WHITESPACE@[42; 43) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0029_cast_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0029_cast_expr.rs new file mode 100644 index 000000000..b571a5860 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0029_cast_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | 82 as i32; | ||
3 | 81 as i8 + 1; | ||
4 | 79 as i16 - 1; | ||
5 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0029_cast_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0029_cast_expr.txt new file mode 100644 index 000000000..cb56aef0b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0029_cast_expr.txt | |||
@@ -0,0 +1,69 @@ | |||
1 | SOURCE_FILE@[0; 65) | ||
2 | FN_DEF@[0; 64) | ||
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@[9; 64) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 25) | ||
15 | CAST_EXPR@[15; 24) | ||
16 | LITERAL@[15; 17) | ||
17 | INT_NUMBER@[15; 17) "82" | ||
18 | WHITESPACE@[17; 18) | ||
19 | AS_KW@[18; 20) | ||
20 | WHITESPACE@[20; 21) | ||
21 | PATH_TYPE@[21; 24) | ||
22 | PATH@[21; 24) | ||
23 | PATH_SEGMENT@[21; 24) | ||
24 | NAME_REF@[21; 24) | ||
25 | IDENT@[21; 24) "i32" | ||
26 | SEMI@[24; 25) | ||
27 | WHITESPACE@[25; 30) | ||
28 | EXPR_STMT@[30; 43) | ||
29 | BIN_EXPR@[30; 42) | ||
30 | CAST_EXPR@[30; 38) | ||
31 | LITERAL@[30; 32) | ||
32 | INT_NUMBER@[30; 32) "81" | ||
33 | WHITESPACE@[32; 33) | ||
34 | AS_KW@[33; 35) | ||
35 | WHITESPACE@[35; 36) | ||
36 | PATH_TYPE@[36; 38) | ||
37 | PATH@[36; 38) | ||
38 | PATH_SEGMENT@[36; 38) | ||
39 | NAME_REF@[36; 38) | ||
40 | IDENT@[36; 38) "i8" | ||
41 | WHITESPACE@[38; 39) | ||
42 | PLUS@[39; 40) | ||
43 | WHITESPACE@[40; 41) | ||
44 | LITERAL@[41; 42) | ||
45 | INT_NUMBER@[41; 42) "1" | ||
46 | SEMI@[42; 43) | ||
47 | WHITESPACE@[43; 48) | ||
48 | EXPR_STMT@[48; 62) | ||
49 | BIN_EXPR@[48; 61) | ||
50 | CAST_EXPR@[48; 57) | ||
51 | LITERAL@[48; 50) | ||
52 | INT_NUMBER@[48; 50) "79" | ||
53 | WHITESPACE@[50; 51) | ||
54 | AS_KW@[51; 53) | ||
55 | WHITESPACE@[53; 54) | ||
56 | PATH_TYPE@[54; 57) | ||
57 | PATH@[54; 57) | ||
58 | PATH_SEGMENT@[54; 57) | ||
59 | NAME_REF@[54; 57) | ||
60 | IDENT@[54; 57) "i16" | ||
61 | WHITESPACE@[57; 58) | ||
62 | MINUS@[58; 59) | ||
63 | WHITESPACE@[59; 60) | ||
64 | LITERAL@[60; 61) | ||
65 | INT_NUMBER@[60; 61) "1" | ||
66 | SEMI@[61; 62) | ||
67 | WHITESPACE@[62; 63) | ||
68 | R_CURLY@[63; 64) | ||
69 | WHITESPACE@[64; 65) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0030_cond.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0030_cond.rs new file mode 100644 index 000000000..fdb37ee6f --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0030_cond.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { if let Some(_) = None {} } | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0030_cond.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0030_cond.txt new file mode 100644 index 000000000..641a09fff --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0030_cond.txt | |||
@@ -0,0 +1,43 @@ | |||
1 | SOURCE_FILE@[0; 38) | ||
2 | FN_DEF@[0; 37) | ||
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@[9; 37) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | IF_EXPR@[11; 35) | ||
15 | IF_KW@[11; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | CONDITION@[14; 32) | ||
18 | LET_KW@[14; 17) | ||
19 | WHITESPACE@[17; 18) | ||
20 | TUPLE_STRUCT_PAT@[18; 25) | ||
21 | PATH@[18; 22) | ||
22 | PATH_SEGMENT@[18; 22) | ||
23 | NAME_REF@[18; 22) | ||
24 | IDENT@[18; 22) "Some" | ||
25 | L_PAREN@[22; 23) | ||
26 | PLACEHOLDER_PAT@[23; 24) | ||
27 | UNDERSCORE@[23; 24) | ||
28 | R_PAREN@[24; 25) | ||
29 | WHITESPACE@[25; 26) | ||
30 | EQ@[26; 27) | ||
31 | WHITESPACE@[27; 28) | ||
32 | PATH_EXPR@[28; 32) | ||
33 | PATH@[28; 32) | ||
34 | PATH_SEGMENT@[28; 32) | ||
35 | NAME_REF@[28; 32) | ||
36 | IDENT@[28; 32) "None" | ||
37 | WHITESPACE@[32; 33) | ||
38 | BLOCK@[33; 35) | ||
39 | L_CURLY@[33; 34) | ||
40 | R_CURLY@[34; 35) | ||
41 | WHITESPACE@[35; 36) | ||
42 | R_CURLY@[36; 37) | ||
43 | WHITESPACE@[37; 38) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0031_while_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0031_while_expr.rs new file mode 100644 index 000000000..293046a04 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0031_while_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | while true {}; | ||
3 | while let Some(x) = it.next() {}; | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0031_while_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0031_while_expr.txt new file mode 100644 index 000000000..f9b074e82 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0031_while_expr.txt | |||
@@ -0,0 +1,66 @@ | |||
1 | SOURCE_FILE@[0; 70) | ||
2 | FN_DEF@[0; 69) | ||
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@[9; 69) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 29) | ||
15 | WHILE_EXPR@[15; 28) | ||
16 | WHILE_KW@[15; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | CONDITION@[21; 25) | ||
19 | LITERAL@[21; 25) | ||
20 | TRUE_KW@[21; 25) | ||
21 | WHITESPACE@[25; 26) | ||
22 | BLOCK@[26; 28) | ||
23 | L_CURLY@[26; 27) | ||
24 | R_CURLY@[27; 28) | ||
25 | SEMI@[28; 29) | ||
26 | WHITESPACE@[29; 34) | ||
27 | EXPR_STMT@[34; 67) | ||
28 | WHILE_EXPR@[34; 66) | ||
29 | WHILE_KW@[34; 39) | ||
30 | WHITESPACE@[39; 40) | ||
31 | CONDITION@[40; 63) | ||
32 | LET_KW@[40; 43) | ||
33 | WHITESPACE@[43; 44) | ||
34 | TUPLE_STRUCT_PAT@[44; 51) | ||
35 | PATH@[44; 48) | ||
36 | PATH_SEGMENT@[44; 48) | ||
37 | NAME_REF@[44; 48) | ||
38 | IDENT@[44; 48) "Some" | ||
39 | L_PAREN@[48; 49) | ||
40 | BIND_PAT@[49; 50) | ||
41 | NAME@[49; 50) | ||
42 | IDENT@[49; 50) "x" | ||
43 | R_PAREN@[50; 51) | ||
44 | WHITESPACE@[51; 52) | ||
45 | EQ@[52; 53) | ||
46 | WHITESPACE@[53; 54) | ||
47 | METHOD_CALL_EXPR@[54; 63) | ||
48 | PATH_EXPR@[54; 56) | ||
49 | PATH@[54; 56) | ||
50 | PATH_SEGMENT@[54; 56) | ||
51 | NAME_REF@[54; 56) | ||
52 | IDENT@[54; 56) "it" | ||
53 | DOT@[56; 57) | ||
54 | NAME_REF@[57; 61) | ||
55 | IDENT@[57; 61) "next" | ||
56 | ARG_LIST@[61; 63) | ||
57 | L_PAREN@[61; 62) | ||
58 | R_PAREN@[62; 63) | ||
59 | WHITESPACE@[63; 64) | ||
60 | BLOCK@[64; 66) | ||
61 | L_CURLY@[64; 65) | ||
62 | R_CURLY@[65; 66) | ||
63 | SEMI@[66; 67) | ||
64 | WHITESPACE@[67; 68) | ||
65 | R_CURLY@[68; 69) | ||
66 | WHITESPACE@[69; 70) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.rs new file mode 100644 index 000000000..c9bf3bdb4 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | type A = fn(); | ||
2 | type B = unsafe fn(); | ||
3 | type C = unsafe extern "C" fn(); | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt new file mode 100644 index 000000000..0c508ec27 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt | |||
@@ -0,0 +1,55 @@ | |||
1 | SOURCE_FILE@[0; 70) | ||
2 | TYPE_DEF@[0; 14) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | FN_POINTER_TYPE@[9; 13) | ||
11 | FN_KW@[9; 11) | ||
12 | PARAM_LIST@[11; 13) | ||
13 | L_PAREN@[11; 12) | ||
14 | R_PAREN@[12; 13) | ||
15 | SEMI@[13; 14) | ||
16 | WHITESPACE@[14; 15) | ||
17 | TYPE_DEF@[15; 36) | ||
18 | TYPE_KW@[15; 19) | ||
19 | WHITESPACE@[19; 20) | ||
20 | NAME@[20; 21) | ||
21 | IDENT@[20; 21) "B" | ||
22 | WHITESPACE@[21; 22) | ||
23 | EQ@[22; 23) | ||
24 | WHITESPACE@[23; 24) | ||
25 | FN_POINTER_TYPE@[24; 35) | ||
26 | UNSAFE_KW@[24; 30) | ||
27 | WHITESPACE@[30; 31) | ||
28 | FN_KW@[31; 33) | ||
29 | PARAM_LIST@[33; 35) | ||
30 | L_PAREN@[33; 34) | ||
31 | R_PAREN@[34; 35) | ||
32 | SEMI@[35; 36) | ||
33 | WHITESPACE@[36; 37) | ||
34 | TYPE_DEF@[37; 69) | ||
35 | TYPE_KW@[37; 41) | ||
36 | WHITESPACE@[41; 42) | ||
37 | NAME@[42; 43) | ||
38 | IDENT@[42; 43) "C" | ||
39 | WHITESPACE@[43; 44) | ||
40 | EQ@[44; 45) | ||
41 | WHITESPACE@[45; 46) | ||
42 | FN_POINTER_TYPE@[46; 68) | ||
43 | UNSAFE_KW@[46; 52) | ||
44 | WHITESPACE@[52; 53) | ||
45 | ABI@[53; 63) | ||
46 | EXTERN_KW@[53; 59) | ||
47 | WHITESPACE@[59; 60) | ||
48 | STRING@[60; 63) | ||
49 | WHITESPACE@[63; 64) | ||
50 | FN_KW@[64; 66) | ||
51 | PARAM_LIST@[66; 68) | ||
52 | L_PAREN@[66; 67) | ||
53 | R_PAREN@[67; 68) | ||
54 | SEMI@[68; 69) | ||
55 | WHITESPACE@[69; 70) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.rs new file mode 100644 index 000000000..3ac0badab --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | type A = &(); | ||
2 | type B = &'static (); | ||
3 | type C = &mut (); | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.txt new file mode 100644 index 000000000..7f35254d1 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.txt | |||
@@ -0,0 +1,50 @@ | |||
1 | SOURCE_FILE@[0; 54) | ||
2 | TYPE_DEF@[0; 13) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | REFERENCE_TYPE@[9; 12) | ||
11 | AMP@[9; 10) | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) | ||
14 | R_PAREN@[11; 12) | ||
15 | SEMI@[12; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | TYPE_DEF@[14; 35) | ||
18 | TYPE_KW@[14; 18) | ||
19 | WHITESPACE@[18; 19) | ||
20 | NAME@[19; 20) | ||
21 | IDENT@[19; 20) "B" | ||
22 | WHITESPACE@[20; 21) | ||
23 | EQ@[21; 22) | ||
24 | WHITESPACE@[22; 23) | ||
25 | REFERENCE_TYPE@[23; 34) | ||
26 | AMP@[23; 24) | ||
27 | LIFETIME@[24; 31) "'static" | ||
28 | WHITESPACE@[31; 32) | ||
29 | TUPLE_TYPE@[32; 34) | ||
30 | L_PAREN@[32; 33) | ||
31 | R_PAREN@[33; 34) | ||
32 | SEMI@[34; 35) | ||
33 | WHITESPACE@[35; 36) | ||
34 | TYPE_DEF@[36; 53) | ||
35 | TYPE_KW@[36; 40) | ||
36 | WHITESPACE@[40; 41) | ||
37 | NAME@[41; 42) | ||
38 | IDENT@[41; 42) "C" | ||
39 | WHITESPACE@[42; 43) | ||
40 | EQ@[43; 44) | ||
41 | WHITESPACE@[44; 45) | ||
42 | REFERENCE_TYPE@[45; 52) | ||
43 | AMP@[45; 46) | ||
44 | MUT_KW@[46; 49) | ||
45 | WHITESPACE@[49; 50) | ||
46 | TUPLE_TYPE@[50; 52) | ||
47 | L_PAREN@[50; 51) | ||
48 | R_PAREN@[51; 52) | ||
49 | SEMI@[52; 53) | ||
50 | WHITESPACE@[53; 54) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0034_break_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0034_break_expr.rs new file mode 100644 index 000000000..1b4094636 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0034_break_expr.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | fn foo() { | ||
2 | loop { | ||
3 | break; | ||
4 | break 'l; | ||
5 | break 92; | ||
6 | break 'l 92; | ||
7 | } | ||
8 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0034_break_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0034_break_expr.txt new file mode 100644 index 000000000..1877311e8 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0034_break_expr.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | SOURCE_FILE@[0; 102) | ||
2 | FN_DEF@[0; 101) | ||
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@[9; 101) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LOOP_EXPR@[15; 99) | ||
15 | LOOP_KW@[15; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | BLOCK@[20; 99) | ||
18 | L_CURLY@[20; 21) | ||
19 | WHITESPACE@[21; 30) | ||
20 | EXPR_STMT@[30; 36) | ||
21 | BREAK_EXPR@[30; 35) | ||
22 | BREAK_KW@[30; 35) | ||
23 | SEMI@[35; 36) | ||
24 | WHITESPACE@[36; 45) | ||
25 | EXPR_STMT@[45; 54) | ||
26 | BREAK_EXPR@[45; 53) | ||
27 | BREAK_KW@[45; 50) | ||
28 | WHITESPACE@[50; 51) | ||
29 | LIFETIME@[51; 53) "'l" | ||
30 | SEMI@[53; 54) | ||
31 | WHITESPACE@[54; 63) | ||
32 | EXPR_STMT@[63; 72) | ||
33 | BREAK_EXPR@[63; 71) | ||
34 | BREAK_KW@[63; 68) | ||
35 | WHITESPACE@[68; 69) | ||
36 | LITERAL@[69; 71) | ||
37 | INT_NUMBER@[69; 71) "92" | ||
38 | SEMI@[71; 72) | ||
39 | WHITESPACE@[72; 81) | ||
40 | EXPR_STMT@[81; 93) | ||
41 | BREAK_EXPR@[81; 92) | ||
42 | BREAK_KW@[81; 86) | ||
43 | WHITESPACE@[86; 87) | ||
44 | LIFETIME@[87; 89) "'l" | ||
45 | WHITESPACE@[89; 90) | ||
46 | LITERAL@[90; 92) | ||
47 | INT_NUMBER@[90; 92) "92" | ||
48 | SEMI@[92; 93) | ||
49 | WHITESPACE@[93; 98) | ||
50 | R_CURLY@[98; 99) | ||
51 | WHITESPACE@[99; 100) | ||
52 | R_CURLY@[100; 101) | ||
53 | WHITESPACE@[101; 102) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.rs new file mode 100644 index 000000000..d9d99d2d3 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { pub 92; } //FIXME | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.txt new file mode 100644 index 000000000..de20eee7a --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | SOURCE_FILE@[0; 29) | ||
2 | FN_DEF@[0; 20) | ||
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@[9; 20) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | EXPR_STMT@[11; 18) | ||
15 | VISIBILITY@[11; 14) | ||
16 | PUB_KW@[11; 14) | ||
17 | WHITESPACE@[14; 15) | ||
18 | LITERAL@[15; 17) | ||
19 | INT_NUMBER@[15; 17) "92" | ||
20 | SEMI@[17; 18) | ||
21 | WHITESPACE@[18; 19) | ||
22 | R_CURLY@[19; 20) | ||
23 | WHITESPACE@[20; 21) | ||
24 | COMMENT@[21; 28) | ||
25 | WHITESPACE@[28; 29) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0036_unsafe_extern_fn.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0036_unsafe_extern_fn.rs new file mode 100644 index 000000000..1295c2cd2 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0036_unsafe_extern_fn.rs | |||
@@ -0,0 +1 @@ | |||
unsafe extern "C" fn foo() {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0036_unsafe_extern_fn.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0036_unsafe_extern_fn.txt new file mode 100644 index 000000000..0cde40595 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0036_unsafe_extern_fn.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | SOURCE_FILE@[0; 30) | ||
2 | FN_DEF@[0; 29) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | ABI@[7; 17) | ||
6 | EXTERN_KW@[7; 13) | ||
7 | WHITESPACE@[13; 14) | ||
8 | STRING@[14; 17) | ||
9 | WHITESPACE@[17; 18) | ||
10 | FN_KW@[18; 20) | ||
11 | WHITESPACE@[20; 21) | ||
12 | NAME@[21; 24) | ||
13 | IDENT@[21; 24) "foo" | ||
14 | PARAM_LIST@[24; 26) | ||
15 | L_PAREN@[24; 25) | ||
16 | R_PAREN@[25; 26) | ||
17 | WHITESPACE@[26; 27) | ||
18 | BLOCK@[27; 29) | ||
19 | L_CURLY@[27; 28) | ||
20 | R_CURLY@[28; 29) | ||
21 | WHITESPACE@[29; 30) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.rs new file mode 100644 index 000000000..d140692e2 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | type X = <A as B>::Output; | ||
2 | fn foo() { <usize as Default>::default(); } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.txt new file mode 100644 index 000000000..394fc7f5b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.txt | |||
@@ -0,0 +1,78 @@ | |||
1 | SOURCE_FILE@[0; 71) | ||
2 | TYPE_DEF@[0; 26) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "X" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PATH_TYPE@[9; 25) | ||
11 | PATH@[9; 25) | ||
12 | PATH@[9; 17) | ||
13 | PATH_SEGMENT@[9; 17) | ||
14 | L_ANGLE@[9; 10) | ||
15 | PATH_TYPE@[10; 11) | ||
16 | PATH@[10; 11) | ||
17 | PATH_SEGMENT@[10; 11) | ||
18 | NAME_REF@[10; 11) | ||
19 | IDENT@[10; 11) "A" | ||
20 | WHITESPACE@[11; 12) | ||
21 | AS_KW@[12; 14) | ||
22 | WHITESPACE@[14; 15) | ||
23 | PATH_TYPE@[15; 16) | ||
24 | PATH@[15; 16) | ||
25 | PATH_SEGMENT@[15; 16) | ||
26 | NAME_REF@[15; 16) | ||
27 | IDENT@[15; 16) "B" | ||
28 | R_ANGLE@[16; 17) | ||
29 | COLONCOLON@[17; 19) | ||
30 | PATH_SEGMENT@[19; 25) | ||
31 | NAME_REF@[19; 25) | ||
32 | IDENT@[19; 25) "Output" | ||
33 | SEMI@[25; 26) | ||
34 | WHITESPACE@[26; 27) | ||
35 | FN_DEF@[27; 70) | ||
36 | FN_KW@[27; 29) | ||
37 | WHITESPACE@[29; 30) | ||
38 | NAME@[30; 33) | ||
39 | IDENT@[30; 33) "foo" | ||
40 | PARAM_LIST@[33; 35) | ||
41 | L_PAREN@[33; 34) | ||
42 | R_PAREN@[34; 35) | ||
43 | WHITESPACE@[35; 36) | ||
44 | BLOCK@[36; 70) | ||
45 | L_CURLY@[36; 37) | ||
46 | WHITESPACE@[37; 38) | ||
47 | EXPR_STMT@[38; 68) | ||
48 | CALL_EXPR@[38; 67) | ||
49 | PATH_EXPR@[38; 65) | ||
50 | PATH@[38; 65) | ||
51 | PATH@[38; 56) | ||
52 | PATH_SEGMENT@[38; 56) | ||
53 | L_ANGLE@[38; 39) | ||
54 | PATH_TYPE@[39; 44) | ||
55 | PATH@[39; 44) | ||
56 | PATH_SEGMENT@[39; 44) | ||
57 | NAME_REF@[39; 44) | ||
58 | IDENT@[39; 44) "usize" | ||
59 | WHITESPACE@[44; 45) | ||
60 | AS_KW@[45; 47) | ||
61 | WHITESPACE@[47; 48) | ||
62 | PATH_TYPE@[48; 55) | ||
63 | PATH@[48; 55) | ||
64 | PATH_SEGMENT@[48; 55) | ||
65 | NAME_REF@[48; 55) | ||
66 | IDENT@[48; 55) "Default" | ||
67 | R_ANGLE@[55; 56) | ||
68 | COLONCOLON@[56; 58) | ||
69 | PATH_SEGMENT@[58; 65) | ||
70 | NAME_REF@[58; 65) | ||
71 | IDENT@[58; 65) "default" | ||
72 | ARG_LIST@[65; 67) | ||
73 | L_PAREN@[65; 66) | ||
74 | R_PAREN@[66; 67) | ||
75 | SEMI@[67; 68) | ||
76 | WHITESPACE@[68; 69) | ||
77 | R_CURLY@[69; 70) | ||
78 | WHITESPACE@[70; 71) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0038_full_range_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0038_full_range_expr.rs new file mode 100644 index 000000000..ae21ad94c --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0038_full_range_expr.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { xs[..]; } | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0038_full_range_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0038_full_range_expr.txt new file mode 100644 index 000000000..caef145ce --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0038_full_range_expr.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | FN_DEF@[0; 20) | ||
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@[9; 20) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | EXPR_STMT@[11; 18) | ||
15 | INDEX_EXPR@[11; 17) | ||
16 | PATH_EXPR@[11; 13) | ||
17 | PATH@[11; 13) | ||
18 | PATH_SEGMENT@[11; 13) | ||
19 | NAME_REF@[11; 13) | ||
20 | IDENT@[11; 13) "xs" | ||
21 | L_BRACK@[13; 14) | ||
22 | RANGE_EXPR@[14; 16) | ||
23 | DOTDOT@[14; 16) | ||
24 | R_BRACK@[16; 17) | ||
25 | SEMI@[17; 18) | ||
26 | WHITESPACE@[18; 19) | ||
27 | R_CURLY@[19; 20) | ||
28 | WHITESPACE@[20; 21) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.rs new file mode 100644 index 000000000..385c43131 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.rs | |||
@@ -0,0 +1 @@ | |||
type A = B<'static, i32, Item=u64>; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.txt new file mode 100644 index 000000000..ccef7188f --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | SOURCE_FILE@[0; 36) | ||
2 | TYPE_DEF@[0; 35) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PATH_TYPE@[9; 34) | ||
11 | PATH@[9; 34) | ||
12 | PATH_SEGMENT@[9; 34) | ||
13 | NAME_REF@[9; 10) | ||
14 | IDENT@[9; 10) "B" | ||
15 | TYPE_ARG_LIST@[10; 34) | ||
16 | L_ANGLE@[10; 11) | ||
17 | LIFETIME_ARG@[11; 18) | ||
18 | LIFETIME@[11; 18) "'static" | ||
19 | COMMA@[18; 19) | ||
20 | WHITESPACE@[19; 20) | ||
21 | TYPE_ARG@[20; 23) | ||
22 | PATH_TYPE@[20; 23) | ||
23 | PATH@[20; 23) | ||
24 | PATH_SEGMENT@[20; 23) | ||
25 | NAME_REF@[20; 23) | ||
26 | IDENT@[20; 23) "i32" | ||
27 | COMMA@[23; 24) | ||
28 | WHITESPACE@[24; 25) | ||
29 | ASSOC_TYPE_ARG@[25; 33) | ||
30 | NAME_REF@[25; 29) | ||
31 | IDENT@[25; 29) "Item" | ||
32 | EQ@[29; 30) | ||
33 | PATH_TYPE@[30; 33) | ||
34 | PATH@[30; 33) | ||
35 | PATH_SEGMENT@[30; 33) | ||
36 | NAME_REF@[30; 33) | ||
37 | IDENT@[30; 33) "u64" | ||
38 | R_ANGLE@[33; 34) | ||
39 | SEMI@[34; 35) | ||
40 | WHITESPACE@[35; 36) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.rs new file mode 100644 index 000000000..660d927cf --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.rs | |||
@@ -0,0 +1 @@ | |||
crate fn main() { } | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.txt new file mode 100644 index 000000000..ff5add838 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | SOURCE_FILE@[0; 20) | ||
2 | FN_DEF@[0; 19) | ||
3 | VISIBILITY@[0; 5) | ||
4 | CRATE_KW@[0; 5) | ||
5 | WHITESPACE@[5; 6) | ||
6 | FN_KW@[6; 8) | ||
7 | WHITESPACE@[8; 9) | ||
8 | NAME@[9; 13) | ||
9 | IDENT@[9; 13) "main" | ||
10 | PARAM_LIST@[13; 15) | ||
11 | L_PAREN@[13; 14) | ||
12 | R_PAREN@[14; 15) | ||
13 | WHITESPACE@[15; 16) | ||
14 | BLOCK@[16; 19) | ||
15 | L_CURLY@[16; 17) | ||
16 | WHITESPACE@[17; 18) | ||
17 | R_CURLY@[18; 19) | ||
18 | WHITESPACE@[19; 20) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0041_trait_item.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0041_trait_item.rs new file mode 100644 index 000000000..4385afca9 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0041_trait_item.rs | |||
@@ -0,0 +1 @@ | |||
trait T<U>: Hash + Clone where U: Copy {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0041_trait_item.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0041_trait_item.txt new file mode 100644 index 000000000..333a737ec --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0041_trait_item.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | SOURCE_FILE@[0; 42) | ||
2 | TRAIT_DEF@[0; 41) | ||
3 | TRAIT_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "T" | ||
7 | TYPE_PARAM_LIST@[7; 10) | ||
8 | L_ANGLE@[7; 8) | ||
9 | TYPE_PARAM@[8; 9) | ||
10 | NAME@[8; 9) | ||
11 | IDENT@[8; 9) "U" | ||
12 | R_ANGLE@[9; 10) | ||
13 | COLON@[10; 11) | ||
14 | WHITESPACE@[11; 12) | ||
15 | PATH_TYPE@[12; 24) | ||
16 | PATH@[12; 16) | ||
17 | PATH_SEGMENT@[12; 16) | ||
18 | NAME_REF@[12; 16) | ||
19 | IDENT@[12; 16) "Hash" | ||
20 | WHITESPACE@[16; 17) | ||
21 | PLUS@[17; 18) | ||
22 | WHITESPACE@[18; 19) | ||
23 | PATH_TYPE@[19; 24) | ||
24 | PATH@[19; 24) | ||
25 | PATH_SEGMENT@[19; 24) | ||
26 | NAME_REF@[19; 24) | ||
27 | IDENT@[19; 24) "Clone" | ||
28 | WHITESPACE@[24; 25) | ||
29 | WHERE_CLAUSE@[25; 38) | ||
30 | WHERE_KW@[25; 30) | ||
31 | WHITESPACE@[30; 31) | ||
32 | WHERE_PRED@[31; 38) | ||
33 | PATH_TYPE@[31; 32) | ||
34 | PATH@[31; 32) | ||
35 | PATH_SEGMENT@[31; 32) | ||
36 | NAME_REF@[31; 32) | ||
37 | IDENT@[31; 32) "U" | ||
38 | COLON@[32; 33) | ||
39 | WHITESPACE@[33; 34) | ||
40 | PATH_TYPE@[34; 38) | ||
41 | PATH@[34; 38) | ||
42 | PATH_SEGMENT@[34; 38) | ||
43 | NAME_REF@[34; 38) | ||
44 | IDENT@[34; 38) "Copy" | ||
45 | WHITESPACE@[38; 39) | ||
46 | ITEM_LIST@[39; 41) | ||
47 | L_CURLY@[39; 40) | ||
48 | R_CURLY@[40; 41) | ||
49 | WHITESPACE@[41; 42) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0042_call_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0042_call_expr.rs new file mode 100644 index 000000000..0c9a20718 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0042_call_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = f(); | ||
3 | let _ = f()(1)(1, 2,); | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0042_call_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0042_call_expr.txt new file mode 100644 index 000000000..6364dc73c --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0042_call_expr.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | SOURCE_FILE@[0; 57) | ||
2 | FN_DEF@[0; 56) | ||
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@[9; 56) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 27) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | CALL_EXPR@[23; 26) | ||
23 | PATH_EXPR@[23; 24) | ||
24 | PATH@[23; 24) | ||
25 | PATH_SEGMENT@[23; 24) | ||
26 | NAME_REF@[23; 24) | ||
27 | IDENT@[23; 24) "f" | ||
28 | ARG_LIST@[24; 26) | ||
29 | L_PAREN@[24; 25) | ||
30 | R_PAREN@[25; 26) | ||
31 | SEMI@[26; 27) | ||
32 | WHITESPACE@[27; 32) | ||
33 | LET_STMT@[32; 54) | ||
34 | LET_KW@[32; 35) | ||
35 | WHITESPACE@[35; 36) | ||
36 | PLACEHOLDER_PAT@[36; 37) | ||
37 | UNDERSCORE@[36; 37) | ||
38 | WHITESPACE@[37; 38) | ||
39 | EQ@[38; 39) | ||
40 | WHITESPACE@[39; 40) | ||
41 | CALL_EXPR@[40; 53) | ||
42 | CALL_EXPR@[40; 46) | ||
43 | CALL_EXPR@[40; 43) | ||
44 | PATH_EXPR@[40; 41) | ||
45 | PATH@[40; 41) | ||
46 | PATH_SEGMENT@[40; 41) | ||
47 | NAME_REF@[40; 41) | ||
48 | IDENT@[40; 41) "f" | ||
49 | ARG_LIST@[41; 43) | ||
50 | L_PAREN@[41; 42) | ||
51 | R_PAREN@[42; 43) | ||
52 | ARG_LIST@[43; 46) | ||
53 | L_PAREN@[43; 44) | ||
54 | LITERAL@[44; 45) | ||
55 | INT_NUMBER@[44; 45) "1" | ||
56 | R_PAREN@[45; 46) | ||
57 | ARG_LIST@[46; 53) | ||
58 | L_PAREN@[46; 47) | ||
59 | LITERAL@[47; 48) | ||
60 | INT_NUMBER@[47; 48) "1" | ||
61 | COMMA@[48; 49) | ||
62 | WHITESPACE@[49; 50) | ||
63 | LITERAL@[50; 51) | ||
64 | INT_NUMBER@[50; 51) "2" | ||
65 | COMMA@[51; 52) | ||
66 | R_PAREN@[52; 53) | ||
67 | SEMI@[53; 54) | ||
68 | WHITESPACE@[54; 55) | ||
69 | R_CURLY@[55; 56) | ||
70 | WHITESPACE@[56; 57) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.rs new file mode 100644 index 000000000..544caa020 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | use some::path as some_name; | ||
2 | use some::{ | ||
3 | other::path as some_other_name, | ||
4 | different::path as different_name, | ||
5 | yet::another::path, | ||
6 | running::out::of::synonyms::for_::different::* | ||
7 | }; | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.txt new file mode 100644 index 000000000..8ef0ecbc6 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.txt | |||
@@ -0,0 +1,123 @@ | |||
1 | SOURCE_FILE@[0; 182) | ||
2 | USE_ITEM@[0; 28) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 27) | ||
6 | PATH@[4; 14) | ||
7 | PATH@[4; 8) | ||
8 | PATH_SEGMENT@[4; 8) | ||
9 | NAME_REF@[4; 8) | ||
10 | IDENT@[4; 8) "some" | ||
11 | COLONCOLON@[8; 10) | ||
12 | PATH_SEGMENT@[10; 14) | ||
13 | NAME_REF@[10; 14) | ||
14 | IDENT@[10; 14) "path" | ||
15 | WHITESPACE@[14; 15) | ||
16 | ALIAS@[15; 27) | ||
17 | AS_KW@[15; 17) | ||
18 | WHITESPACE@[17; 18) | ||
19 | NAME@[18; 27) | ||
20 | IDENT@[18; 27) "some_name" | ||
21 | SEMI@[27; 28) | ||
22 | WHITESPACE@[28; 29) | ||
23 | USE_ITEM@[29; 181) | ||
24 | USE_KW@[29; 32) | ||
25 | WHITESPACE@[32; 33) | ||
26 | USE_TREE@[33; 180) | ||
27 | PATH@[33; 37) | ||
28 | PATH_SEGMENT@[33; 37) | ||
29 | NAME_REF@[33; 37) | ||
30 | IDENT@[33; 37) "some" | ||
31 | COLONCOLON@[37; 39) | ||
32 | USE_TREE_LIST@[39; 180) | ||
33 | L_CURLY@[39; 40) | ||
34 | WHITESPACE@[40; 42) | ||
35 | USE_TREE@[42; 72) | ||
36 | PATH@[42; 53) | ||
37 | PATH@[42; 47) | ||
38 | PATH_SEGMENT@[42; 47) | ||
39 | NAME_REF@[42; 47) | ||
40 | IDENT@[42; 47) "other" | ||
41 | COLONCOLON@[47; 49) | ||
42 | PATH_SEGMENT@[49; 53) | ||
43 | NAME_REF@[49; 53) | ||
44 | IDENT@[49; 53) "path" | ||
45 | WHITESPACE@[53; 54) | ||
46 | ALIAS@[54; 72) | ||
47 | AS_KW@[54; 56) | ||
48 | WHITESPACE@[56; 57) | ||
49 | NAME@[57; 72) | ||
50 | IDENT@[57; 72) "some_other_name" | ||
51 | COMMA@[72; 73) | ||
52 | WHITESPACE@[73; 75) | ||
53 | USE_TREE@[75; 108) | ||
54 | PATH@[75; 90) | ||
55 | PATH@[75; 84) | ||
56 | PATH_SEGMENT@[75; 84) | ||
57 | NAME_REF@[75; 84) | ||
58 | IDENT@[75; 84) "different" | ||
59 | COLONCOLON@[84; 86) | ||
60 | PATH_SEGMENT@[86; 90) | ||
61 | NAME_REF@[86; 90) | ||
62 | IDENT@[86; 90) "path" | ||
63 | WHITESPACE@[90; 91) | ||
64 | ALIAS@[91; 108) | ||
65 | AS_KW@[91; 93) | ||
66 | WHITESPACE@[93; 94) | ||
67 | NAME@[94; 108) | ||
68 | IDENT@[94; 108) "different_name" | ||
69 | COMMA@[108; 109) | ||
70 | WHITESPACE@[109; 111) | ||
71 | USE_TREE@[111; 129) | ||
72 | PATH@[111; 129) | ||
73 | PATH@[111; 123) | ||
74 | PATH@[111; 114) | ||
75 | PATH_SEGMENT@[111; 114) | ||
76 | NAME_REF@[111; 114) | ||
77 | IDENT@[111; 114) "yet" | ||
78 | COLONCOLON@[114; 116) | ||
79 | PATH_SEGMENT@[116; 123) | ||
80 | NAME_REF@[116; 123) | ||
81 | IDENT@[116; 123) "another" | ||
82 | COLONCOLON@[123; 125) | ||
83 | PATH_SEGMENT@[125; 129) | ||
84 | NAME_REF@[125; 129) | ||
85 | IDENT@[125; 129) "path" | ||
86 | COMMA@[129; 130) | ||
87 | WHITESPACE@[130; 132) | ||
88 | USE_TREE@[132; 178) | ||
89 | PATH@[132; 175) | ||
90 | PATH@[132; 164) | ||
91 | PATH@[132; 158) | ||
92 | PATH@[132; 148) | ||
93 | PATH@[132; 144) | ||
94 | PATH@[132; 139) | ||
95 | PATH_SEGMENT@[132; 139) | ||
96 | NAME_REF@[132; 139) | ||
97 | IDENT@[132; 139) "running" | ||
98 | COLONCOLON@[139; 141) | ||
99 | PATH_SEGMENT@[141; 144) | ||
100 | NAME_REF@[141; 144) | ||
101 | IDENT@[141; 144) "out" | ||
102 | COLONCOLON@[144; 146) | ||
103 | PATH_SEGMENT@[146; 148) | ||
104 | NAME_REF@[146; 148) | ||
105 | IDENT@[146; 148) "of" | ||
106 | COLONCOLON@[148; 150) | ||
107 | PATH_SEGMENT@[150; 158) | ||
108 | NAME_REF@[150; 158) | ||
109 | IDENT@[150; 158) "synonyms" | ||
110 | COLONCOLON@[158; 160) | ||
111 | PATH_SEGMENT@[160; 164) | ||
112 | NAME_REF@[160; 164) | ||
113 | IDENT@[160; 164) "for_" | ||
114 | COLONCOLON@[164; 166) | ||
115 | PATH_SEGMENT@[166; 175) | ||
116 | NAME_REF@[166; 175) | ||
117 | IDENT@[166; 175) "different" | ||
118 | COLONCOLON@[175; 177) | ||
119 | STAR@[177; 178) | ||
120 | WHITESPACE@[178; 179) | ||
121 | R_CURLY@[179; 180) | ||
122 | SEMI@[180; 181) | ||
123 | WHITESPACE@[181; 182) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0044_block_items.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0044_block_items.rs new file mode 100644 index 000000000..d9868718c --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0044_block_items.rs | |||
@@ -0,0 +1 @@ | |||
fn a() { fn b() {} } | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0044_block_items.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0044_block_items.txt new file mode 100644 index 000000000..dd1843ee5 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0044_block_items.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | FN_DEF@[0; 20) | ||
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@[7; 20) | ||
12 | L_CURLY@[7; 8) | ||
13 | WHITESPACE@[8; 9) | ||
14 | FN_DEF@[9; 18) | ||
15 | FN_KW@[9; 11) | ||
16 | WHITESPACE@[11; 12) | ||
17 | NAME@[12; 13) | ||
18 | IDENT@[12; 13) "b" | ||
19 | PARAM_LIST@[13; 15) | ||
20 | L_PAREN@[13; 14) | ||
21 | R_PAREN@[14; 15) | ||
22 | WHITESPACE@[15; 16) | ||
23 | BLOCK@[16; 18) | ||
24 | L_CURLY@[16; 17) | ||
25 | R_CURLY@[17; 18) | ||
26 | WHITESPACE@[18; 19) | ||
27 | R_CURLY@[19; 20) | ||
28 | WHITESPACE@[20; 21) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0045_param_list_opt_patterns.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0045_param_list_opt_patterns.rs new file mode 100644 index 000000000..9b93442c0 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0045_param_list_opt_patterns.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<F: FnMut(&mut Foo<'a>)>(){} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0045_param_list_opt_patterns.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0045_param_list_opt_patterns.txt new file mode 100644 index 000000000..2ce7a6714 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0045_param_list_opt_patterns.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | SOURCE_FILE@[0; 35) | ||
2 | FN_DEF@[0; 34) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | TYPE_PARAM_LIST@[6; 30) | ||
8 | L_ANGLE@[6; 7) | ||
9 | TYPE_PARAM@[7; 29) | ||
10 | NAME@[7; 8) | ||
11 | IDENT@[7; 8) "F" | ||
12 | COLON@[8; 9) | ||
13 | WHITESPACE@[9; 10) | ||
14 | PATH_TYPE@[10; 29) | ||
15 | PATH@[10; 29) | ||
16 | PATH_SEGMENT@[10; 29) | ||
17 | NAME_REF@[10; 15) | ||
18 | IDENT@[10; 15) "FnMut" | ||
19 | PARAM_LIST@[15; 29) | ||
20 | L_PAREN@[15; 16) | ||
21 | PARAM@[16; 28) | ||
22 | REFERENCE_TYPE@[16; 28) | ||
23 | AMP@[16; 17) | ||
24 | MUT_KW@[17; 20) | ||
25 | WHITESPACE@[20; 21) | ||
26 | PATH_TYPE@[21; 28) | ||
27 | PATH@[21; 28) | ||
28 | PATH_SEGMENT@[21; 28) | ||
29 | NAME_REF@[21; 24) | ||
30 | IDENT@[21; 24) "Foo" | ||
31 | TYPE_ARG_LIST@[24; 28) | ||
32 | L_ANGLE@[24; 25) | ||
33 | LIFETIME_ARG@[25; 27) | ||
34 | LIFETIME@[25; 27) "'a" | ||
35 | R_ANGLE@[27; 28) | ||
36 | R_PAREN@[28; 29) | ||
37 | R_ANGLE@[29; 30) | ||
38 | PARAM_LIST@[30; 32) | ||
39 | L_PAREN@[30; 31) | ||
40 | R_PAREN@[31; 32) | ||
41 | BLOCK@[32; 34) | ||
42 | L_CURLY@[32; 33) | ||
43 | R_CURLY@[33; 34) | ||
44 | WHITESPACE@[34; 35) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.rs new file mode 100644 index 000000000..cb66bad24 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (i32,); | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.txt new file mode 100644 index 000000000..173c325d0 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | SOURCE_FILE@[0; 17) | ||
2 | TYPE_DEF@[0; 16) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | TUPLE_TYPE@[9; 15) | ||
11 | L_PAREN@[9; 10) | ||
12 | PATH_TYPE@[10; 13) | ||
13 | PATH@[10; 13) | ||
14 | PATH_SEGMENT@[10; 13) | ||
15 | NAME_REF@[10; 13) | ||
16 | IDENT@[10; 13) "i32" | ||
17 | COMMA@[13; 14) | ||
18 | R_PAREN@[14; 15) | ||
19 | SEMI@[15; 16) | ||
20 | WHITESPACE@[16; 17) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0047_unsafe_default_impl.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0047_unsafe_default_impl.rs new file mode 100644 index 000000000..9cd6c57bd --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0047_unsafe_default_impl.rs | |||
@@ -0,0 +1 @@ | |||
unsafe default impl Foo {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0047_unsafe_default_impl.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0047_unsafe_default_impl.txt new file mode 100644 index 000000000..6003ba645 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0047_unsafe_default_impl.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | SOURCE_FILE@[0; 27) | ||
2 | IMPL_ITEM@[0; 26) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | DEFAULT_KW@[7; 14) | ||
6 | WHITESPACE@[14; 15) | ||
7 | IMPL_KW@[15; 19) | ||
8 | WHITESPACE@[19; 20) | ||
9 | PATH_TYPE@[20; 23) | ||
10 | PATH@[20; 23) | ||
11 | PATH_SEGMENT@[20; 23) | ||
12 | NAME_REF@[20; 23) | ||
13 | IDENT@[20; 23) "Foo" | ||
14 | WHITESPACE@[23; 24) | ||
15 | ITEM_LIST@[24; 26) | ||
16 | L_CURLY@[24; 25) | ||
17 | R_CURLY@[25; 26) | ||
18 | WHITESPACE@[26; 27) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0048_path_type_with_bounds.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0048_path_type_with_bounds.rs new file mode 100644 index 000000000..215210e27 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0048_path_type_with_bounds.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() -> Box<T + 'f> {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0048_path_type_with_bounds.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0048_path_type_with_bounds.txt new file mode 100644 index 000000000..911a27ea1 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0048_path_type_with_bounds.txt | |||
@@ -0,0 +1,36 @@ | |||
1 | SOURCE_FILE@[0; 27) | ||
2 | FN_DEF@[0; 26) | ||
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 | RET_TYPE@[9; 23) | ||
12 | THIN_ARROW@[9; 11) | ||
13 | WHITESPACE@[11; 12) | ||
14 | PATH_TYPE@[12; 23) | ||
15 | PATH@[12; 23) | ||
16 | PATH_SEGMENT@[12; 23) | ||
17 | NAME_REF@[12; 15) | ||
18 | IDENT@[12; 15) "Box" | ||
19 | TYPE_ARG_LIST@[15; 23) | ||
20 | L_ANGLE@[15; 16) | ||
21 | TYPE_ARG@[16; 22) | ||
22 | PATH_TYPE@[16; 22) | ||
23 | PATH@[16; 17) | ||
24 | PATH_SEGMENT@[16; 17) | ||
25 | NAME_REF@[16; 17) | ||
26 | IDENT@[16; 17) "T" | ||
27 | WHITESPACE@[17; 18) | ||
28 | PLUS@[18; 19) | ||
29 | WHITESPACE@[19; 20) | ||
30 | LIFETIME@[20; 22) "'f" | ||
31 | R_ANGLE@[22; 23) | ||
32 | WHITESPACE@[23; 24) | ||
33 | BLOCK@[24; 26) | ||
34 | L_CURLY@[24; 25) | ||
35 | R_CURLY@[25; 26) | ||
36 | WHITESPACE@[26; 27) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0049_let_stmt;.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0049_let_stmt;.rs new file mode 100644 index 000000000..0a9af907f --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0049_let_stmt;.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let a; | ||
3 | let b: i32; | ||
4 | let c = 92; | ||
5 | let d: i32 = 92; | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0049_let_stmt;.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0049_let_stmt;.txt new file mode 100644 index 000000000..9c2aad7e0 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0049_let_stmt;.txt | |||
@@ -0,0 +1,71 @@ | |||
1 | SOURCE_FILE@[0; 77) | ||
2 | FN_DEF@[0; 76) | ||
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@[9; 76) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 21) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | BIND_PAT@[19; 20) | ||
18 | NAME@[19; 20) | ||
19 | IDENT@[19; 20) "a" | ||
20 | SEMI@[20; 21) | ||
21 | WHITESPACE@[21; 26) | ||
22 | LET_STMT@[26; 37) | ||
23 | LET_KW@[26; 29) | ||
24 | WHITESPACE@[29; 30) | ||
25 | BIND_PAT@[30; 31) | ||
26 | NAME@[30; 31) | ||
27 | IDENT@[30; 31) "b" | ||
28 | COLON@[31; 32) | ||
29 | WHITESPACE@[32; 33) | ||
30 | PATH_TYPE@[33; 36) | ||
31 | PATH@[33; 36) | ||
32 | PATH_SEGMENT@[33; 36) | ||
33 | NAME_REF@[33; 36) | ||
34 | IDENT@[33; 36) "i32" | ||
35 | SEMI@[36; 37) | ||
36 | WHITESPACE@[37; 42) | ||
37 | LET_STMT@[42; 53) | ||
38 | LET_KW@[42; 45) | ||
39 | WHITESPACE@[45; 46) | ||
40 | BIND_PAT@[46; 47) | ||
41 | NAME@[46; 47) | ||
42 | IDENT@[46; 47) "c" | ||
43 | WHITESPACE@[47; 48) | ||
44 | EQ@[48; 49) | ||
45 | WHITESPACE@[49; 50) | ||
46 | LITERAL@[50; 52) | ||
47 | INT_NUMBER@[50; 52) "92" | ||
48 | SEMI@[52; 53) | ||
49 | WHITESPACE@[53; 58) | ||
50 | LET_STMT@[58; 74) | ||
51 | LET_KW@[58; 61) | ||
52 | WHITESPACE@[61; 62) | ||
53 | BIND_PAT@[62; 63) | ||
54 | NAME@[62; 63) | ||
55 | IDENT@[62; 63) "d" | ||
56 | COLON@[63; 64) | ||
57 | WHITESPACE@[64; 65) | ||
58 | PATH_TYPE@[65; 68) | ||
59 | PATH@[65; 68) | ||
60 | PATH_SEGMENT@[65; 68) | ||
61 | NAME_REF@[65; 68) | ||
62 | IDENT@[65; 68) "i32" | ||
63 | WHITESPACE@[68; 69) | ||
64 | EQ@[69; 70) | ||
65 | WHITESPACE@[70; 71) | ||
66 | LITERAL@[71; 73) | ||
67 | INT_NUMBER@[71; 73) "92" | ||
68 | SEMI@[73; 74) | ||
69 | WHITESPACE@[74; 75) | ||
70 | R_CURLY@[75; 76) | ||
71 | WHITESPACE@[76; 77) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0050_fn_decl.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0050_fn_decl.rs new file mode 100644 index 000000000..c9f74f7f5 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0050_fn_decl.rs | |||
@@ -0,0 +1 @@ | |||
trait T { fn foo(); } | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0050_fn_decl.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0050_fn_decl.txt new file mode 100644 index 000000000..bb87e1d06 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0050_fn_decl.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | SOURCE_FILE@[0; 22) | ||
2 | TRAIT_DEF@[0; 21) | ||
3 | TRAIT_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "T" | ||
7 | WHITESPACE@[7; 8) | ||
8 | ITEM_LIST@[8; 21) | ||
9 | L_CURLY@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | FN_DEF@[10; 19) | ||
12 | FN_KW@[10; 12) | ||
13 | WHITESPACE@[12; 13) | ||
14 | NAME@[13; 16) | ||
15 | IDENT@[13; 16) "foo" | ||
16 | PARAM_LIST@[16; 18) | ||
17 | L_PAREN@[16; 17) | ||
18 | R_PAREN@[17; 18) | ||
19 | SEMI@[18; 19) | ||
20 | WHITESPACE@[19; 20) | ||
21 | R_CURLY@[20; 21) | ||
22 | WHITESPACE@[21; 22) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.rs new file mode 100644 index 000000000..c039cf7d3 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (); | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.txt new file mode 100644 index 000000000..9fd19ba4a --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | SOURCE_FILE@[0; 13) | ||
2 | TYPE_DEF@[0; 12) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | TUPLE_TYPE@[9; 11) | ||
11 | L_PAREN@[9; 10) | ||
12 | R_PAREN@[10; 11) | ||
13 | SEMI@[11; 12) | ||
14 | WHITESPACE@[12; 13) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.rs new file mode 100644 index 000000000..bf94f32e1 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | type A = Foo; | ||
2 | type B = ::Foo; | ||
3 | type C = self::Foo; | ||
4 | type D = super::Foo; | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.txt new file mode 100644 index 000000000..b72b96e95 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | SOURCE_FILE@[0; 71) | ||
2 | TYPE_DEF@[0; 13) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PATH_TYPE@[9; 12) | ||
11 | PATH@[9; 12) | ||
12 | PATH_SEGMENT@[9; 12) | ||
13 | NAME_REF@[9; 12) | ||
14 | IDENT@[9; 12) "Foo" | ||
15 | SEMI@[12; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | TYPE_DEF@[14; 29) | ||
18 | TYPE_KW@[14; 18) | ||
19 | WHITESPACE@[18; 19) | ||
20 | NAME@[19; 20) | ||
21 | IDENT@[19; 20) "B" | ||
22 | WHITESPACE@[20; 21) | ||
23 | EQ@[21; 22) | ||
24 | WHITESPACE@[22; 23) | ||
25 | PATH_TYPE@[23; 28) | ||
26 | PATH@[23; 28) | ||
27 | PATH_SEGMENT@[23; 28) | ||
28 | COLONCOLON@[23; 25) | ||
29 | NAME_REF@[25; 28) | ||
30 | IDENT@[25; 28) "Foo" | ||
31 | SEMI@[28; 29) | ||
32 | WHITESPACE@[29; 30) | ||
33 | TYPE_DEF@[30; 49) | ||
34 | TYPE_KW@[30; 34) | ||
35 | WHITESPACE@[34; 35) | ||
36 | NAME@[35; 36) | ||
37 | IDENT@[35; 36) "C" | ||
38 | WHITESPACE@[36; 37) | ||
39 | EQ@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||
41 | PATH_TYPE@[39; 48) | ||
42 | PATH@[39; 48) | ||
43 | PATH@[39; 43) | ||
44 | PATH_SEGMENT@[39; 43) | ||
45 | SELF_KW@[39; 43) | ||
46 | COLONCOLON@[43; 45) | ||
47 | PATH_SEGMENT@[45; 48) | ||
48 | NAME_REF@[45; 48) | ||
49 | IDENT@[45; 48) "Foo" | ||
50 | SEMI@[48; 49) | ||
51 | WHITESPACE@[49; 50) | ||
52 | TYPE_DEF@[50; 70) | ||
53 | TYPE_KW@[50; 54) | ||
54 | WHITESPACE@[54; 55) | ||
55 | NAME@[55; 56) | ||
56 | IDENT@[55; 56) "D" | ||
57 | WHITESPACE@[56; 57) | ||
58 | EQ@[57; 58) | ||
59 | WHITESPACE@[58; 59) | ||
60 | PATH_TYPE@[59; 69) | ||
61 | PATH@[59; 69) | ||
62 | PATH@[59; 64) | ||
63 | PATH_SEGMENT@[59; 64) | ||
64 | SUPER_KW@[59; 64) | ||
65 | COLONCOLON@[64; 66) | ||
66 | PATH_SEGMENT@[66; 69) | ||
67 | NAME_REF@[66; 69) | ||
68 | IDENT@[66; 69) "Foo" | ||
69 | SEMI@[69; 70) | ||
70 | WHITESPACE@[70; 71) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0053_path_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0053_path_expr.rs new file mode 100644 index 000000000..333ebabef --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0053_path_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let _ = a; | ||
3 | let _ = a::b; | ||
4 | let _ = ::a::<b>; | ||
5 | let _ = format!(); | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0053_path_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0053_path_expr.txt new file mode 100644 index 000000000..673ea1d3d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0053_path_expr.txt | |||
@@ -0,0 +1,95 @@ | |||
1 | SOURCE_FILE@[0; 91) | ||
2 | FN_DEF@[0; 90) | ||
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@[9; 90) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 25) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | PATH_EXPR@[23; 24) | ||
23 | PATH@[23; 24) | ||
24 | PATH_SEGMENT@[23; 24) | ||
25 | NAME_REF@[23; 24) | ||
26 | IDENT@[23; 24) "a" | ||
27 | SEMI@[24; 25) | ||
28 | WHITESPACE@[25; 30) | ||
29 | LET_STMT@[30; 43) | ||
30 | LET_KW@[30; 33) | ||
31 | WHITESPACE@[33; 34) | ||
32 | PLACEHOLDER_PAT@[34; 35) | ||
33 | UNDERSCORE@[34; 35) | ||
34 | WHITESPACE@[35; 36) | ||
35 | EQ@[36; 37) | ||
36 | WHITESPACE@[37; 38) | ||
37 | PATH_EXPR@[38; 42) | ||
38 | PATH@[38; 42) | ||
39 | PATH@[38; 39) | ||
40 | PATH_SEGMENT@[38; 39) | ||
41 | NAME_REF@[38; 39) | ||
42 | IDENT@[38; 39) "a" | ||
43 | COLONCOLON@[39; 41) | ||
44 | PATH_SEGMENT@[41; 42) | ||
45 | NAME_REF@[41; 42) | ||
46 | IDENT@[41; 42) "b" | ||
47 | SEMI@[42; 43) | ||
48 | WHITESPACE@[43; 48) | ||
49 | LET_STMT@[48; 65) | ||
50 | LET_KW@[48; 51) | ||
51 | WHITESPACE@[51; 52) | ||
52 | PLACEHOLDER_PAT@[52; 53) | ||
53 | UNDERSCORE@[52; 53) | ||
54 | WHITESPACE@[53; 54) | ||
55 | EQ@[54; 55) | ||
56 | WHITESPACE@[55; 56) | ||
57 | PATH_EXPR@[56; 64) | ||
58 | PATH@[56; 64) | ||
59 | PATH_SEGMENT@[56; 64) | ||
60 | COLONCOLON@[56; 58) | ||
61 | NAME_REF@[58; 59) | ||
62 | IDENT@[58; 59) "a" | ||
63 | TYPE_ARG_LIST@[59; 64) | ||
64 | COLONCOLON@[59; 61) | ||
65 | L_ANGLE@[61; 62) | ||
66 | TYPE_ARG@[62; 63) | ||
67 | PATH_TYPE@[62; 63) | ||
68 | PATH@[62; 63) | ||
69 | PATH_SEGMENT@[62; 63) | ||
70 | NAME_REF@[62; 63) | ||
71 | IDENT@[62; 63) "b" | ||
72 | R_ANGLE@[63; 64) | ||
73 | SEMI@[64; 65) | ||
74 | WHITESPACE@[65; 70) | ||
75 | LET_STMT@[70; 88) | ||
76 | LET_KW@[70; 73) | ||
77 | WHITESPACE@[73; 74) | ||
78 | PLACEHOLDER_PAT@[74; 75) | ||
79 | UNDERSCORE@[74; 75) | ||
80 | WHITESPACE@[75; 76) | ||
81 | EQ@[76; 77) | ||
82 | WHITESPACE@[77; 78) | ||
83 | MACRO_CALL@[78; 87) | ||
84 | PATH@[78; 84) | ||
85 | PATH_SEGMENT@[78; 84) | ||
86 | NAME_REF@[78; 84) | ||
87 | IDENT@[78; 84) "format" | ||
88 | EXCL@[84; 85) | ||
89 | TOKEN_TREE@[85; 87) | ||
90 | L_PAREN@[85; 86) | ||
91 | R_PAREN@[86; 87) | ||
92 | SEMI@[87; 88) | ||
93 | WHITESPACE@[88; 89) | ||
94 | R_CURLY@[89; 90) | ||
95 | WHITESPACE@[90; 91) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0054_field_attrs.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0054_field_attrs.rs new file mode 100644 index 000000000..4744d8ac0 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0054_field_attrs.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | struct S { | ||
2 | #[serde(with = "url_serde")] | ||
3 | pub uri: Uri, | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0054_field_attrs.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0054_field_attrs.txt new file mode 100644 index 000000000..e02ebf400 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0054_field_attrs.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | SOURCE_FILE@[0; 64) | ||
2 | STRUCT_DEF@[0; 63) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | WHITESPACE@[8; 9) | ||
8 | NAMED_FIELD_DEF_LIST@[9; 63) | ||
9 | L_CURLY@[9; 10) | ||
10 | WHITESPACE@[10; 15) | ||
11 | NAMED_FIELD_DEF@[15; 60) | ||
12 | ATTR@[15; 43) | ||
13 | POUND@[15; 16) | ||
14 | TOKEN_TREE@[16; 43) | ||
15 | L_BRACK@[16; 17) | ||
16 | IDENT@[17; 22) "serde" | ||
17 | TOKEN_TREE@[22; 42) | ||
18 | L_PAREN@[22; 23) | ||
19 | IDENT@[23; 27) "with" | ||
20 | WHITESPACE@[27; 28) | ||
21 | EQ@[28; 29) | ||
22 | WHITESPACE@[29; 30) | ||
23 | STRING@[30; 41) | ||
24 | R_PAREN@[41; 42) | ||
25 | R_BRACK@[42; 43) | ||
26 | WHITESPACE@[43; 48) | ||
27 | VISIBILITY@[48; 51) | ||
28 | PUB_KW@[48; 51) | ||
29 | WHITESPACE@[51; 52) | ||
30 | NAME@[52; 55) | ||
31 | IDENT@[52; 55) "uri" | ||
32 | COLON@[55; 56) | ||
33 | WHITESPACE@[56; 57) | ||
34 | PATH_TYPE@[57; 60) | ||
35 | PATH@[57; 60) | ||
36 | PATH_SEGMENT@[57; 60) | ||
37 | NAME_REF@[57; 60) | ||
38 | IDENT@[57; 60) "Uri" | ||
39 | COMMA@[60; 61) | ||
40 | WHITESPACE@[61; 62) | ||
41 | R_CURLY@[62; 63) | ||
42 | WHITESPACE@[63; 64) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0055_literal_pattern.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0055_literal_pattern.rs new file mode 100644 index 000000000..16f674d9d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0055_literal_pattern.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn main() { | ||
2 | match () { | ||
3 | 92 => (), | ||
4 | 'c' => (), | ||
5 | "hello" => (), | ||
6 | } | ||
7 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0055_literal_pattern.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0055_literal_pattern.txt new file mode 100644 index 000000000..99b289d56 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0055_literal_pattern.txt | |||
@@ -0,0 +1,60 @@ | |||
1 | SOURCE_FILE@[0; 95) | ||
2 | FN_DEF@[0; 94) | ||
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@[10; 94) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | MATCH_EXPR@[16; 92) | ||
15 | MATCH_KW@[16; 21) | ||
16 | WHITESPACE@[21; 22) | ||
17 | TUPLE_EXPR@[22; 24) | ||
18 | L_PAREN@[22; 23) | ||
19 | R_PAREN@[23; 24) | ||
20 | WHITESPACE@[24; 25) | ||
21 | MATCH_ARM_LIST@[25; 92) | ||
22 | L_CURLY@[25; 26) | ||
23 | WHITESPACE@[26; 35) | ||
24 | MATCH_ARM@[35; 43) | ||
25 | LITERAL@[35; 37) | ||
26 | INT_NUMBER@[35; 37) "92" | ||
27 | WHITESPACE@[37; 38) | ||
28 | FAT_ARROW@[38; 40) | ||
29 | WHITESPACE@[40; 41) | ||
30 | TUPLE_EXPR@[41; 43) | ||
31 | L_PAREN@[41; 42) | ||
32 | R_PAREN@[42; 43) | ||
33 | COMMA@[43; 44) | ||
34 | WHITESPACE@[44; 53) | ||
35 | MATCH_ARM@[53; 62) | ||
36 | LITERAL@[53; 56) | ||
37 | CHAR@[53; 56) | ||
38 | WHITESPACE@[56; 57) | ||
39 | FAT_ARROW@[57; 59) | ||
40 | WHITESPACE@[59; 60) | ||
41 | TUPLE_EXPR@[60; 62) | ||
42 | L_PAREN@[60; 61) | ||
43 | R_PAREN@[61; 62) | ||
44 | COMMA@[62; 63) | ||
45 | WHITESPACE@[63; 72) | ||
46 | MATCH_ARM@[72; 85) | ||
47 | LITERAL@[72; 79) | ||
48 | STRING@[72; 79) | ||
49 | WHITESPACE@[79; 80) | ||
50 | FAT_ARROW@[80; 82) | ||
51 | WHITESPACE@[82; 83) | ||
52 | TUPLE_EXPR@[83; 85) | ||
53 | L_PAREN@[83; 84) | ||
54 | R_PAREN@[84; 85) | ||
55 | COMMA@[85; 86) | ||
56 | WHITESPACE@[86; 91) | ||
57 | R_CURLY@[91; 92) | ||
58 | WHITESPACE@[92; 93) | ||
59 | R_CURLY@[93; 94) | ||
60 | WHITESPACE@[94; 95) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0056_where_clause.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0056_where_clause.rs new file mode 100644 index 000000000..592a005f9 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0056_where_clause.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() | ||
2 | where | ||
3 | 'a: 'b + 'c, | ||
4 | T: Clone + Copy + 'static, | ||
5 | Iterator::Item: 'a, | ||
6 | {} | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0056_where_clause.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0056_where_clause.txt new file mode 100644 index 000000000..54c3d64f1 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0056_where_clause.txt | |||
@@ -0,0 +1,71 @@ | |||
1 | SOURCE_FILE@[0; 87) | ||
2 | FN_DEF@[0; 86) | ||
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 | WHERE_CLAUSE@[9; 83) | ||
12 | WHERE_KW@[9; 14) | ||
13 | WHITESPACE@[14; 18) | ||
14 | WHERE_PRED@[18; 29) | ||
15 | LIFETIME@[18; 20) "'a" | ||
16 | COLON@[20; 21) | ||
17 | WHITESPACE@[21; 22) | ||
18 | LIFETIME@[22; 24) "'b" | ||
19 | WHITESPACE@[24; 25) | ||
20 | PLUS@[25; 26) | ||
21 | WHITESPACE@[26; 27) | ||
22 | LIFETIME@[27; 29) "'c" | ||
23 | COMMA@[29; 30) | ||
24 | WHITESPACE@[30; 34) | ||
25 | WHERE_PRED@[34; 59) | ||
26 | PATH_TYPE@[34; 35) | ||
27 | PATH@[34; 35) | ||
28 | PATH_SEGMENT@[34; 35) | ||
29 | NAME_REF@[34; 35) | ||
30 | IDENT@[34; 35) "T" | ||
31 | COLON@[35; 36) | ||
32 | WHITESPACE@[36; 37) | ||
33 | PATH_TYPE@[37; 59) | ||
34 | PATH@[37; 42) | ||
35 | PATH_SEGMENT@[37; 42) | ||
36 | NAME_REF@[37; 42) | ||
37 | IDENT@[37; 42) "Clone" | ||
38 | WHITESPACE@[42; 43) | ||
39 | PLUS@[43; 44) | ||
40 | WHITESPACE@[44; 45) | ||
41 | PATH_TYPE@[45; 59) | ||
42 | PATH@[45; 49) | ||
43 | PATH_SEGMENT@[45; 49) | ||
44 | NAME_REF@[45; 49) | ||
45 | IDENT@[45; 49) "Copy" | ||
46 | WHITESPACE@[49; 50) | ||
47 | PLUS@[50; 51) | ||
48 | WHITESPACE@[51; 52) | ||
49 | LIFETIME@[52; 59) "'static" | ||
50 | COMMA@[59; 60) | ||
51 | WHITESPACE@[60; 64) | ||
52 | WHERE_PRED@[64; 82) | ||
53 | PATH_TYPE@[64; 78) | ||
54 | PATH@[64; 78) | ||
55 | PATH@[64; 72) | ||
56 | PATH_SEGMENT@[64; 72) | ||
57 | NAME_REF@[64; 72) | ||
58 | IDENT@[64; 72) "Iterator" | ||
59 | COLONCOLON@[72; 74) | ||
60 | PATH_SEGMENT@[74; 78) | ||
61 | NAME_REF@[74; 78) | ||
62 | IDENT@[74; 78) "Item" | ||
63 | COLON@[78; 79) | ||
64 | WHITESPACE@[79; 80) | ||
65 | LIFETIME@[80; 82) "'a" | ||
66 | COMMA@[82; 83) | ||
67 | WHITESPACE@[83; 84) | ||
68 | BLOCK@[84; 86) | ||
69 | L_CURLY@[84; 85) | ||
70 | R_CURLY@[85; 86) | ||
71 | WHITESPACE@[86; 87) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0057_const_fn.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0057_const_fn.rs new file mode 100644 index 000000000..8c84d9cd7 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0057_const_fn.rs | |||
@@ -0,0 +1 @@ | |||
const fn foo() {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0057_const_fn.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0057_const_fn.txt new file mode 100644 index 000000000..8206d973b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0057_const_fn.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 18) | ||
2 | FN_DEF@[0; 17) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | FN_KW@[6; 8) | ||
6 | WHITESPACE@[8; 9) | ||
7 | NAME@[9; 12) | ||
8 | IDENT@[9; 12) "foo" | ||
9 | PARAM_LIST@[12; 14) | ||
10 | L_PAREN@[12; 13) | ||
11 | R_PAREN@[13; 14) | ||
12 | WHITESPACE@[14; 15) | ||
13 | BLOCK@[15; 17) | ||
14 | L_CURLY@[15; 16) | ||
15 | R_CURLY@[16; 17) | ||
16 | WHITESPACE@[17; 18) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0058_range_pat.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0058_range_pat.rs new file mode 100644 index 000000000..c12ab6fce --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0058_range_pat.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn main() { | ||
2 | match 92 { | ||
3 | 0 ... 100 => (), | ||
4 | 101 ..= 200 => (), | ||
5 | 200 .. 301=> (), | ||
6 | } | ||
7 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0058_range_pat.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0058_range_pat.txt new file mode 100644 index 000000000..d47f38903 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0058_range_pat.txt | |||
@@ -0,0 +1,76 @@ | |||
1 | SOURCE_FILE@[0; 112) | ||
2 | FN_DEF@[0; 111) | ||
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@[10; 111) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | MATCH_EXPR@[16; 109) | ||
15 | MATCH_KW@[16; 21) | ||
16 | WHITESPACE@[21; 22) | ||
17 | LITERAL@[22; 24) | ||
18 | INT_NUMBER@[22; 24) "92" | ||
19 | WHITESPACE@[24; 25) | ||
20 | MATCH_ARM_LIST@[25; 109) | ||
21 | L_CURLY@[25; 26) | ||
22 | WHITESPACE@[26; 35) | ||
23 | MATCH_ARM@[35; 50) | ||
24 | RANGE_PAT@[35; 44) | ||
25 | LITERAL@[35; 36) | ||
26 | INT_NUMBER@[35; 36) "0" | ||
27 | WHITESPACE@[36; 37) | ||
28 | DOTDOTDOT@[37; 40) | ||
29 | WHITESPACE@[40; 41) | ||
30 | LITERAL@[41; 44) | ||
31 | INT_NUMBER@[41; 44) "100" | ||
32 | WHITESPACE@[44; 45) | ||
33 | FAT_ARROW@[45; 47) | ||
34 | WHITESPACE@[47; 48) | ||
35 | TUPLE_EXPR@[48; 50) | ||
36 | L_PAREN@[48; 49) | ||
37 | R_PAREN@[49; 50) | ||
38 | COMMA@[50; 51) | ||
39 | WHITESPACE@[51; 60) | ||
40 | MATCH_ARM@[60; 77) | ||
41 | RANGE_PAT@[60; 71) | ||
42 | LITERAL@[60; 63) | ||
43 | INT_NUMBER@[60; 63) "101" | ||
44 | WHITESPACE@[63; 64) | ||
45 | DOTDOTEQ@[64; 67) | ||
46 | WHITESPACE@[67; 68) | ||
47 | LITERAL@[68; 71) | ||
48 | INT_NUMBER@[68; 71) "200" | ||
49 | WHITESPACE@[71; 72) | ||
50 | FAT_ARROW@[72; 74) | ||
51 | WHITESPACE@[74; 75) | ||
52 | TUPLE_EXPR@[75; 77) | ||
53 | L_PAREN@[75; 76) | ||
54 | R_PAREN@[76; 77) | ||
55 | COMMA@[77; 78) | ||
56 | WHITESPACE@[78; 87) | ||
57 | MATCH_ARM@[87; 102) | ||
58 | RANGE_PAT@[87; 97) | ||
59 | LITERAL@[87; 90) | ||
60 | INT_NUMBER@[87; 90) "200" | ||
61 | WHITESPACE@[90; 91) | ||
62 | DOTDOT@[91; 93) | ||
63 | WHITESPACE@[93; 94) | ||
64 | LITERAL@[94; 97) | ||
65 | INT_NUMBER@[94; 97) "301" | ||
66 | FAT_ARROW@[97; 99) | ||
67 | WHITESPACE@[99; 100) | ||
68 | TUPLE_EXPR@[100; 102) | ||
69 | L_PAREN@[100; 101) | ||
70 | R_PAREN@[101; 102) | ||
71 | COMMA@[102; 103) | ||
72 | WHITESPACE@[103; 108) | ||
73 | R_CURLY@[108; 109) | ||
74 | WHITESPACE@[109; 110) | ||
75 | R_CURLY@[110; 111) | ||
76 | WHITESPACE@[111; 112) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0059_match_arms_commas.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0059_match_arms_commas.rs new file mode 100644 index 000000000..1f25d577a --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0059_match_arms_commas.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => (), | ||
4 | _ => {} | ||
5 | _ => () | ||
6 | } | ||
7 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0059_match_arms_commas.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0059_match_arms_commas.txt new file mode 100644 index 000000000..1034846c8 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0059_match_arms_commas.txt | |||
@@ -0,0 +1,59 @@ | |||
1 | SOURCE_FILE@[0; 83) | ||
2 | FN_DEF@[0; 82) | ||
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@[9; 82) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | MATCH_EXPR@[15; 80) | ||
15 | MATCH_KW@[15; 20) | ||
16 | WHITESPACE@[20; 21) | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) | ||
19 | R_PAREN@[22; 23) | ||
20 | WHITESPACE@[23; 24) | ||
21 | MATCH_ARM_LIST@[24; 80) | ||
22 | L_CURLY@[24; 25) | ||
23 | WHITESPACE@[25; 34) | ||
24 | MATCH_ARM@[34; 41) | ||
25 | PLACEHOLDER_PAT@[34; 35) | ||
26 | UNDERSCORE@[34; 35) | ||
27 | WHITESPACE@[35; 36) | ||
28 | FAT_ARROW@[36; 38) | ||
29 | WHITESPACE@[38; 39) | ||
30 | TUPLE_EXPR@[39; 41) | ||
31 | L_PAREN@[39; 40) | ||
32 | R_PAREN@[40; 41) | ||
33 | COMMA@[41; 42) | ||
34 | WHITESPACE@[42; 51) | ||
35 | MATCH_ARM@[51; 58) | ||
36 | PLACEHOLDER_PAT@[51; 52) | ||
37 | UNDERSCORE@[51; 52) | ||
38 | WHITESPACE@[52; 53) | ||
39 | FAT_ARROW@[53; 55) | ||
40 | WHITESPACE@[55; 56) | ||
41 | BLOCK_EXPR@[56; 58) | ||
42 | BLOCK@[56; 58) | ||
43 | L_CURLY@[56; 57) | ||
44 | R_CURLY@[57; 58) | ||
45 | WHITESPACE@[58; 67) | ||
46 | MATCH_ARM@[67; 74) | ||
47 | PLACEHOLDER_PAT@[67; 68) | ||
48 | UNDERSCORE@[67; 68) | ||
49 | WHITESPACE@[68; 69) | ||
50 | FAT_ARROW@[69; 71) | ||
51 | WHITESPACE@[71; 72) | ||
52 | TUPLE_EXPR@[72; 74) | ||
53 | L_PAREN@[72; 73) | ||
54 | R_PAREN@[73; 74) | ||
55 | WHITESPACE@[74; 79) | ||
56 | R_CURLY@[79; 80) | ||
57 | WHITESPACE@[80; 81) | ||
58 | R_CURLY@[81; 82) | ||
59 | WHITESPACE@[82; 83) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0060_extern_crate.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0060_extern_crate.rs new file mode 100644 index 000000000..49af74e1b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0060_extern_crate.rs | |||
@@ -0,0 +1 @@ | |||
extern crate foo; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0060_extern_crate.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0060_extern_crate.txt new file mode 100644 index 000000000..7ffdc7fbd --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0060_extern_crate.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | SOURCE_FILE@[0; 18) | ||
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) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0061_struct_lit.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0061_struct_lit.rs new file mode 100644 index 000000000..eb711f68a --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0061_struct_lit.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | S {}; | ||
3 | S { x, y: 32, }; | ||
4 | S { x, y: 32, ..Default::default() }; | ||
5 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0061_struct_lit.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0061_struct_lit.txt new file mode 100644 index 000000000..aec25403d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0061_struct_lit.txt | |||
@@ -0,0 +1,97 @@ | |||
1 | SOURCE_FILE@[0; 86) | ||
2 | FN_DEF@[0; 85) | ||
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@[9; 85) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 20) | ||
15 | STRUCT_LIT@[15; 19) | ||
16 | PATH@[15; 16) | ||
17 | PATH_SEGMENT@[15; 16) | ||
18 | NAME_REF@[15; 16) | ||
19 | IDENT@[15; 16) "S" | ||
20 | WHITESPACE@[16; 17) | ||
21 | NAMED_FIELD_LIST@[17; 19) | ||
22 | L_CURLY@[17; 18) | ||
23 | R_CURLY@[18; 19) | ||
24 | SEMI@[19; 20) | ||
25 | WHITESPACE@[20; 25) | ||
26 | EXPR_STMT@[25; 41) | ||
27 | STRUCT_LIT@[25; 40) | ||
28 | PATH@[25; 26) | ||
29 | PATH_SEGMENT@[25; 26) | ||
30 | NAME_REF@[25; 26) | ||
31 | IDENT@[25; 26) "S" | ||
32 | WHITESPACE@[26; 27) | ||
33 | NAMED_FIELD_LIST@[27; 40) | ||
34 | L_CURLY@[27; 28) | ||
35 | WHITESPACE@[28; 29) | ||
36 | NAMED_FIELD@[29; 30) | ||
37 | NAME_REF@[29; 30) | ||
38 | IDENT@[29; 30) "x" | ||
39 | COMMA@[30; 31) | ||
40 | WHITESPACE@[31; 32) | ||
41 | NAMED_FIELD@[32; 37) | ||
42 | NAME_REF@[32; 33) | ||
43 | IDENT@[32; 33) "y" | ||
44 | COLON@[33; 34) | ||
45 | WHITESPACE@[34; 35) | ||
46 | LITERAL@[35; 37) | ||
47 | INT_NUMBER@[35; 37) "32" | ||
48 | COMMA@[37; 38) | ||
49 | WHITESPACE@[38; 39) | ||
50 | R_CURLY@[39; 40) | ||
51 | SEMI@[40; 41) | ||
52 | WHITESPACE@[41; 46) | ||
53 | EXPR_STMT@[46; 83) | ||
54 | STRUCT_LIT@[46; 82) | ||
55 | PATH@[46; 47) | ||
56 | PATH_SEGMENT@[46; 47) | ||
57 | NAME_REF@[46; 47) | ||
58 | IDENT@[46; 47) "S" | ||
59 | WHITESPACE@[47; 48) | ||
60 | NAMED_FIELD_LIST@[48; 82) | ||
61 | L_CURLY@[48; 49) | ||
62 | WHITESPACE@[49; 50) | ||
63 | NAMED_FIELD@[50; 51) | ||
64 | NAME_REF@[50; 51) | ||
65 | IDENT@[50; 51) "x" | ||
66 | COMMA@[51; 52) | ||
67 | WHITESPACE@[52; 53) | ||
68 | NAMED_FIELD@[53; 58) | ||
69 | NAME_REF@[53; 54) | ||
70 | IDENT@[53; 54) "y" | ||
71 | COLON@[54; 55) | ||
72 | WHITESPACE@[55; 56) | ||
73 | LITERAL@[56; 58) | ||
74 | INT_NUMBER@[56; 58) "32" | ||
75 | COMMA@[58; 59) | ||
76 | WHITESPACE@[59; 60) | ||
77 | DOTDOT@[60; 62) | ||
78 | CALL_EXPR@[62; 80) | ||
79 | PATH_EXPR@[62; 78) | ||
80 | PATH@[62; 78) | ||
81 | PATH@[62; 69) | ||
82 | PATH_SEGMENT@[62; 69) | ||
83 | NAME_REF@[62; 69) | ||
84 | IDENT@[62; 69) "Default" | ||
85 | COLONCOLON@[69; 71) | ||
86 | PATH_SEGMENT@[71; 78) | ||
87 | NAME_REF@[71; 78) | ||
88 | IDENT@[71; 78) "default" | ||
89 | ARG_LIST@[78; 80) | ||
90 | L_PAREN@[78; 79) | ||
91 | R_PAREN@[79; 80) | ||
92 | WHITESPACE@[80; 81) | ||
93 | R_CURLY@[81; 82) | ||
94 | SEMI@[82; 83) | ||
95 | WHITESPACE@[83; 84) | ||
96 | R_CURLY@[84; 85) | ||
97 | WHITESPACE@[85; 86) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0062_mod_contents.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0062_mod_contents.rs new file mode 100644 index 000000000..24a15c5c5 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0062_mod_contents.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() {} | ||
2 | macro_rules! foo {} | ||
3 | foo::bar!(); | ||
4 | super::baz! {} | ||
5 | struct S; | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0062_mod_contents.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0062_mod_contents.txt new file mode 100644 index 000000000..62528ca47 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0062_mod_contents.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | SOURCE_FILE@[0; 70) | ||
2 | FN_DEF@[0; 11) | ||
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@[9; 11) | ||
12 | L_CURLY@[9; 10) | ||
13 | R_CURLY@[10; 11) | ||
14 | WHITESPACE@[11; 12) | ||
15 | MACRO_CALL@[12; 31) | ||
16 | PATH@[12; 23) | ||
17 | PATH_SEGMENT@[12; 23) | ||
18 | NAME_REF@[12; 23) | ||
19 | IDENT@[12; 23) "macro_rules" | ||
20 | EXCL@[23; 24) | ||
21 | WHITESPACE@[24; 25) | ||
22 | IDENT@[25; 28) "foo" | ||
23 | WHITESPACE@[28; 29) | ||
24 | TOKEN_TREE@[29; 31) | ||
25 | L_CURLY@[29; 30) | ||
26 | R_CURLY@[30; 31) | ||
27 | WHITESPACE@[31; 32) | ||
28 | MACRO_CALL@[32; 44) | ||
29 | PATH@[32; 40) | ||
30 | PATH@[32; 35) | ||
31 | PATH_SEGMENT@[32; 35) | ||
32 | NAME_REF@[32; 35) | ||
33 | IDENT@[32; 35) "foo" | ||
34 | COLONCOLON@[35; 37) | ||
35 | PATH_SEGMENT@[37; 40) | ||
36 | NAME_REF@[37; 40) | ||
37 | IDENT@[37; 40) "bar" | ||
38 | EXCL@[40; 41) | ||
39 | TOKEN_TREE@[41; 43) | ||
40 | L_PAREN@[41; 42) | ||
41 | R_PAREN@[42; 43) | ||
42 | SEMI@[43; 44) | ||
43 | WHITESPACE@[44; 45) | ||
44 | MACRO_CALL@[45; 59) | ||
45 | PATH@[45; 55) | ||
46 | PATH@[45; 50) | ||
47 | PATH_SEGMENT@[45; 50) | ||
48 | SUPER_KW@[45; 50) | ||
49 | COLONCOLON@[50; 52) | ||
50 | PATH_SEGMENT@[52; 55) | ||
51 | NAME_REF@[52; 55) | ||
52 | IDENT@[52; 55) "baz" | ||
53 | EXCL@[55; 56) | ||
54 | WHITESPACE@[56; 57) | ||
55 | TOKEN_TREE@[57; 59) | ||
56 | L_CURLY@[57; 58) | ||
57 | R_CURLY@[58; 59) | ||
58 | WHITESPACE@[59; 60) | ||
59 | STRUCT_DEF@[60; 69) | ||
60 | STRUCT_KW@[60; 66) | ||
61 | WHITESPACE@[66; 67) | ||
62 | NAME@[67; 68) | ||
63 | IDENT@[67; 68) "S" | ||
64 | SEMI@[68; 69) | ||
65 | WHITESPACE@[69; 70) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0063_impl_item_neg.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0063_impl_item_neg.rs new file mode 100644 index 000000000..b7527c870 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0063_impl_item_neg.rs | |||
@@ -0,0 +1 @@ | |||
impl !Send for X {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0063_impl_item_neg.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0063_impl_item_neg.txt new file mode 100644 index 000000000..b83db380e --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0063_impl_item_neg.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | SOURCE_FILE@[0; 20) | ||
2 | IMPL_ITEM@[0; 19) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | EXCL@[5; 6) | ||
6 | PATH_TYPE@[6; 10) | ||
7 | PATH@[6; 10) | ||
8 | PATH_SEGMENT@[6; 10) | ||
9 | NAME_REF@[6; 10) | ||
10 | IDENT@[6; 10) "Send" | ||
11 | WHITESPACE@[10; 11) | ||
12 | FOR_KW@[11; 14) | ||
13 | WHITESPACE@[14; 15) | ||
14 | PATH_TYPE@[15; 16) | ||
15 | PATH@[15; 16) | ||
16 | PATH_SEGMENT@[15; 16) | ||
17 | NAME_REF@[15; 16) | ||
18 | IDENT@[15; 16) "X" | ||
19 | WHITESPACE@[16; 17) | ||
20 | ITEM_LIST@[17; 19) | ||
21 | L_CURLY@[17; 18) | ||
22 | R_CURLY@[18; 19) | ||
23 | WHITESPACE@[19; 20) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0064_if_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0064_if_expr.rs new file mode 100644 index 000000000..4b0d9af89 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0064_if_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | if true {}; | ||
3 | if true {} else {}; | ||
4 | if true {} else if false {} else {}; | ||
5 | if S {}; | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0064_if_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0064_if_expr.txt new file mode 100644 index 000000000..637d23d9e --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0064_if_expr.txt | |||
@@ -0,0 +1,95 @@ | |||
1 | SOURCE_FILE@[0; 107) | ||
2 | FN_DEF@[0; 106) | ||
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@[9; 106) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 26) | ||
15 | IF_EXPR@[15; 25) | ||
16 | IF_KW@[15; 17) | ||
17 | WHITESPACE@[17; 18) | ||
18 | CONDITION@[18; 22) | ||
19 | LITERAL@[18; 22) | ||
20 | TRUE_KW@[18; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | BLOCK@[23; 25) | ||
23 | L_CURLY@[23; 24) | ||
24 | R_CURLY@[24; 25) | ||
25 | SEMI@[25; 26) | ||
26 | WHITESPACE@[26; 31) | ||
27 | EXPR_STMT@[31; 50) | ||
28 | IF_EXPR@[31; 49) | ||
29 | IF_KW@[31; 33) | ||
30 | WHITESPACE@[33; 34) | ||
31 | CONDITION@[34; 38) | ||
32 | LITERAL@[34; 38) | ||
33 | TRUE_KW@[34; 38) | ||
34 | WHITESPACE@[38; 39) | ||
35 | BLOCK@[39; 41) | ||
36 | L_CURLY@[39; 40) | ||
37 | R_CURLY@[40; 41) | ||
38 | WHITESPACE@[41; 42) | ||
39 | ELSE_KW@[42; 46) | ||
40 | WHITESPACE@[46; 47) | ||
41 | BLOCK@[47; 49) | ||
42 | L_CURLY@[47; 48) | ||
43 | R_CURLY@[48; 49) | ||
44 | SEMI@[49; 50) | ||
45 | WHITESPACE@[50; 55) | ||
46 | EXPR_STMT@[55; 91) | ||
47 | IF_EXPR@[55; 90) | ||
48 | IF_KW@[55; 57) | ||
49 | WHITESPACE@[57; 58) | ||
50 | CONDITION@[58; 62) | ||
51 | LITERAL@[58; 62) | ||
52 | TRUE_KW@[58; 62) | ||
53 | WHITESPACE@[62; 63) | ||
54 | BLOCK@[63; 65) | ||
55 | L_CURLY@[63; 64) | ||
56 | R_CURLY@[64; 65) | ||
57 | WHITESPACE@[65; 66) | ||
58 | ELSE_KW@[66; 70) | ||
59 | WHITESPACE@[70; 71) | ||
60 | IF_EXPR@[71; 90) | ||
61 | IF_KW@[71; 73) | ||
62 | WHITESPACE@[73; 74) | ||
63 | CONDITION@[74; 79) | ||
64 | LITERAL@[74; 79) | ||
65 | FALSE_KW@[74; 79) | ||
66 | WHITESPACE@[79; 80) | ||
67 | BLOCK@[80; 82) | ||
68 | L_CURLY@[80; 81) | ||
69 | R_CURLY@[81; 82) | ||
70 | WHITESPACE@[82; 83) | ||
71 | ELSE_KW@[83; 87) | ||
72 | WHITESPACE@[87; 88) | ||
73 | BLOCK@[88; 90) | ||
74 | L_CURLY@[88; 89) | ||
75 | R_CURLY@[89; 90) | ||
76 | SEMI@[90; 91) | ||
77 | WHITESPACE@[91; 96) | ||
78 | EXPR_STMT@[96; 104) | ||
79 | IF_EXPR@[96; 103) | ||
80 | IF_KW@[96; 98) | ||
81 | WHITESPACE@[98; 99) | ||
82 | CONDITION@[99; 100) | ||
83 | PATH_EXPR@[99; 100) | ||
84 | PATH@[99; 100) | ||
85 | PATH_SEGMENT@[99; 100) | ||
86 | NAME_REF@[99; 100) | ||
87 | IDENT@[99; 100) "S" | ||
88 | WHITESPACE@[100; 101) | ||
89 | BLOCK@[101; 103) | ||
90 | L_CURLY@[101; 102) | ||
91 | R_CURLY@[102; 103) | ||
92 | SEMI@[103; 104) | ||
93 | WHITESPACE@[104; 105) | ||
94 | R_CURLY@[105; 106) | ||
95 | WHITESPACE@[106; 107) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.rs new file mode 100644 index 000000000..c3ecabb99 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.rs | |||
@@ -0,0 +1 @@ | |||
type A = dyn Iterator<Item=Foo<'a>> + 'a; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.txt new file mode 100644 index 000000000..d07fe70b2 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | SOURCE_FILE@[0; 42) | ||
2 | TYPE_DEF@[0; 41) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | DYN_TRAIT_TYPE@[9; 40) | ||
11 | DYN_KW@[9; 12) | ||
12 | WHITESPACE@[12; 13) | ||
13 | PATH_TYPE@[13; 40) | ||
14 | PATH@[13; 35) | ||
15 | PATH_SEGMENT@[13; 35) | ||
16 | NAME_REF@[13; 21) | ||
17 | IDENT@[13; 21) "Iterator" | ||
18 | TYPE_ARG_LIST@[21; 35) | ||
19 | L_ANGLE@[21; 22) | ||
20 | ASSOC_TYPE_ARG@[22; 34) | ||
21 | NAME_REF@[22; 26) | ||
22 | IDENT@[22; 26) "Item" | ||
23 | EQ@[26; 27) | ||
24 | PATH_TYPE@[27; 34) | ||
25 | PATH@[27; 34) | ||
26 | PATH_SEGMENT@[27; 34) | ||
27 | NAME_REF@[27; 30) | ||
28 | IDENT@[27; 30) "Foo" | ||
29 | TYPE_ARG_LIST@[30; 34) | ||
30 | L_ANGLE@[30; 31) | ||
31 | LIFETIME_ARG@[31; 33) | ||
32 | LIFETIME@[31; 33) "'a" | ||
33 | R_ANGLE@[33; 34) | ||
34 | R_ANGLE@[34; 35) | ||
35 | WHITESPACE@[35; 36) | ||
36 | PLUS@[36; 37) | ||
37 | WHITESPACE@[37; 38) | ||
38 | LIFETIME@[38; 40) "'a" | ||
39 | SEMI@[40; 41) | ||
40 | WHITESPACE@[41; 42) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0066_match_arm.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0066_match_arm.rs new file mode 100644 index 000000000..9e009e24f --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0066_match_arm.rs | |||
@@ -0,0 +1,9 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => (), | ||
4 | _ if Test > Test{field: 0} => (), | ||
5 | X | Y if Z => (), | ||
6 | | X | Y if Z => (), | ||
7 | | X => (), | ||
8 | }; | ||
9 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0066_match_arm.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0066_match_arm.txt new file mode 100644 index 000000000..98e7535a3 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0066_match_arm.txt | |||
@@ -0,0 +1,146 @@ | |||
1 | SOURCE_FILE@[0; 167) | ||
2 | FN_DEF@[0; 166) | ||
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@[9; 166) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 164) | ||
15 | MATCH_EXPR@[15; 163) | ||
16 | MATCH_KW@[15; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | TUPLE_EXPR@[21; 23) | ||
19 | L_PAREN@[21; 22) | ||
20 | R_PAREN@[22; 23) | ||
21 | WHITESPACE@[23; 24) | ||
22 | MATCH_ARM_LIST@[24; 163) | ||
23 | L_CURLY@[24; 25) | ||
24 | WHITESPACE@[25; 34) | ||
25 | MATCH_ARM@[34; 41) | ||
26 | PLACEHOLDER_PAT@[34; 35) | ||
27 | UNDERSCORE@[34; 35) | ||
28 | WHITESPACE@[35; 36) | ||
29 | FAT_ARROW@[36; 38) | ||
30 | WHITESPACE@[38; 39) | ||
31 | TUPLE_EXPR@[39; 41) | ||
32 | L_PAREN@[39; 40) | ||
33 | R_PAREN@[40; 41) | ||
34 | COMMA@[41; 42) | ||
35 | WHITESPACE@[42; 51) | ||
36 | MATCH_ARM@[51; 83) | ||
37 | PLACEHOLDER_PAT@[51; 52) | ||
38 | UNDERSCORE@[51; 52) | ||
39 | WHITESPACE@[52; 53) | ||
40 | IF_KW@[53; 55) | ||
41 | WHITESPACE@[55; 56) | ||
42 | BIN_EXPR@[56; 77) | ||
43 | PATH_EXPR@[56; 60) | ||
44 | PATH@[56; 60) | ||
45 | PATH_SEGMENT@[56; 60) | ||
46 | NAME_REF@[56; 60) | ||
47 | IDENT@[56; 60) "Test" | ||
48 | WHITESPACE@[60; 61) | ||
49 | R_ANGLE@[61; 62) | ||
50 | WHITESPACE@[62; 63) | ||
51 | STRUCT_LIT@[63; 77) | ||
52 | PATH@[63; 67) | ||
53 | PATH_SEGMENT@[63; 67) | ||
54 | NAME_REF@[63; 67) | ||
55 | IDENT@[63; 67) "Test" | ||
56 | NAMED_FIELD_LIST@[67; 77) | ||
57 | L_CURLY@[67; 68) | ||
58 | NAMED_FIELD@[68; 76) | ||
59 | NAME_REF@[68; 73) | ||
60 | IDENT@[68; 73) "field" | ||
61 | COLON@[73; 74) | ||
62 | WHITESPACE@[74; 75) | ||
63 | LITERAL@[75; 76) | ||
64 | INT_NUMBER@[75; 76) "0" | ||
65 | R_CURLY@[76; 77) | ||
66 | WHITESPACE@[77; 78) | ||
67 | FAT_ARROW@[78; 80) | ||
68 | WHITESPACE@[80; 81) | ||
69 | TUPLE_EXPR@[81; 83) | ||
70 | L_PAREN@[81; 82) | ||
71 | R_PAREN@[82; 83) | ||
72 | COMMA@[83; 84) | ||
73 | WHITESPACE@[84; 93) | ||
74 | MATCH_ARM@[93; 109) | ||
75 | BIND_PAT@[93; 94) | ||
76 | NAME@[93; 94) | ||
77 | IDENT@[93; 94) "X" | ||
78 | WHITESPACE@[94; 95) | ||
79 | PIPE@[95; 96) | ||
80 | WHITESPACE@[96; 97) | ||
81 | BIND_PAT@[97; 98) | ||
82 | NAME@[97; 98) | ||
83 | IDENT@[97; 98) "Y" | ||
84 | WHITESPACE@[98; 99) | ||
85 | IF_KW@[99; 101) | ||
86 | WHITESPACE@[101; 102) | ||
87 | PATH_EXPR@[102; 103) | ||
88 | PATH@[102; 103) | ||
89 | PATH_SEGMENT@[102; 103) | ||
90 | NAME_REF@[102; 103) | ||
91 | IDENT@[102; 103) "Z" | ||
92 | WHITESPACE@[103; 104) | ||
93 | FAT_ARROW@[104; 106) | ||
94 | WHITESPACE@[106; 107) | ||
95 | TUPLE_EXPR@[107; 109) | ||
96 | L_PAREN@[107; 108) | ||
97 | R_PAREN@[108; 109) | ||
98 | COMMA@[109; 110) | ||
99 | WHITESPACE@[110; 119) | ||
100 | MATCH_ARM@[119; 137) | ||
101 | PIPE@[119; 120) | ||
102 | WHITESPACE@[120; 121) | ||
103 | BIND_PAT@[121; 122) | ||
104 | NAME@[121; 122) | ||
105 | IDENT@[121; 122) "X" | ||
106 | WHITESPACE@[122; 123) | ||
107 | PIPE@[123; 124) | ||
108 | WHITESPACE@[124; 125) | ||
109 | BIND_PAT@[125; 126) | ||
110 | NAME@[125; 126) | ||
111 | IDENT@[125; 126) "Y" | ||
112 | WHITESPACE@[126; 127) | ||
113 | IF_KW@[127; 129) | ||
114 | WHITESPACE@[129; 130) | ||
115 | PATH_EXPR@[130; 131) | ||
116 | PATH@[130; 131) | ||
117 | PATH_SEGMENT@[130; 131) | ||
118 | NAME_REF@[130; 131) | ||
119 | IDENT@[130; 131) "Z" | ||
120 | WHITESPACE@[131; 132) | ||
121 | FAT_ARROW@[132; 134) | ||
122 | WHITESPACE@[134; 135) | ||
123 | TUPLE_EXPR@[135; 137) | ||
124 | L_PAREN@[135; 136) | ||
125 | R_PAREN@[136; 137) | ||
126 | COMMA@[137; 138) | ||
127 | WHITESPACE@[138; 147) | ||
128 | MATCH_ARM@[147; 156) | ||
129 | PIPE@[147; 148) | ||
130 | WHITESPACE@[148; 149) | ||
131 | BIND_PAT@[149; 150) | ||
132 | NAME@[149; 150) | ||
133 | IDENT@[149; 150) "X" | ||
134 | WHITESPACE@[150; 151) | ||
135 | FAT_ARROW@[151; 153) | ||
136 | WHITESPACE@[153; 154) | ||
137 | TUPLE_EXPR@[154; 156) | ||
138 | L_PAREN@[154; 155) | ||
139 | R_PAREN@[155; 156) | ||
140 | COMMA@[156; 157) | ||
141 | WHITESPACE@[157; 162) | ||
142 | R_CURLY@[162; 163) | ||
143 | SEMI@[163; 164) | ||
144 | WHITESPACE@[164; 165) | ||
145 | R_CURLY@[165; 166) | ||
146 | WHITESPACE@[166; 167) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0067_crate_path.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0067_crate_path.rs new file mode 100644 index 000000000..1bbb5930b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0067_crate_path.rs | |||
@@ -0,0 +1 @@ | |||
use crate::foo; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0067_crate_path.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0067_crate_path.txt new file mode 100644 index 000000000..382286457 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0067_crate_path.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | SOURCE_FILE@[0; 16) | ||
2 | USE_ITEM@[0; 15) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 14) | ||
6 | PATH@[4; 14) | ||
7 | PATH@[4; 9) | ||
8 | PATH_SEGMENT@[4; 9) | ||
9 | CRATE_KW@[4; 9) | ||
10 | COLONCOLON@[9; 11) | ||
11 | PATH_SEGMENT@[11; 14) | ||
12 | NAME_REF@[11; 14) | ||
13 | IDENT@[11; 14) "foo" | ||
14 | SEMI@[14; 15) | ||
15 | WHITESPACE@[15; 16) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0068_union_items.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0068_union_items.rs new file mode 100644 index 000000000..b7dd610d8 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0068_union_items.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | union Foo {} | ||
2 | union Foo { | ||
3 | a: i32, | ||
4 | b: f32, | ||
5 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0068_union_items.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0068_union_items.txt new file mode 100644 index 000000000..2d2fb1a0b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0068_union_items.txt | |||
@@ -0,0 +1,46 @@ | |||
1 | SOURCE_FILE@[0; 51) | ||
2 | STRUCT_DEF@[0; 12) | ||
3 | UNION_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | NAME@[6; 9) | ||
6 | IDENT@[6; 9) "Foo" | ||
7 | WHITESPACE@[9; 10) | ||
8 | NAMED_FIELD_DEF_LIST@[10; 12) | ||
9 | L_CURLY@[10; 11) | ||
10 | R_CURLY@[11; 12) | ||
11 | WHITESPACE@[12; 13) | ||
12 | STRUCT_DEF@[13; 50) | ||
13 | UNION_KW@[13; 18) | ||
14 | WHITESPACE@[18; 19) | ||
15 | NAME@[19; 22) | ||
16 | IDENT@[19; 22) "Foo" | ||
17 | WHITESPACE@[22; 23) | ||
18 | NAMED_FIELD_DEF_LIST@[23; 50) | ||
19 | L_CURLY@[23; 24) | ||
20 | WHITESPACE@[24; 29) | ||
21 | NAMED_FIELD_DEF@[29; 35) | ||
22 | NAME@[29; 30) | ||
23 | IDENT@[29; 30) "a" | ||
24 | COLON@[30; 31) | ||
25 | WHITESPACE@[31; 32) | ||
26 | PATH_TYPE@[32; 35) | ||
27 | PATH@[32; 35) | ||
28 | PATH_SEGMENT@[32; 35) | ||
29 | NAME_REF@[32; 35) | ||
30 | IDENT@[32; 35) "i32" | ||
31 | COMMA@[35; 36) | ||
32 | WHITESPACE@[36; 41) | ||
33 | NAMED_FIELD_DEF@[41; 47) | ||
34 | NAME@[41; 42) | ||
35 | IDENT@[41; 42) "b" | ||
36 | COLON@[42; 43) | ||
37 | WHITESPACE@[43; 44) | ||
38 | PATH_TYPE@[44; 47) | ||
39 | PATH@[44; 47) | ||
40 | PATH_SEGMENT@[44; 47) | ||
41 | NAME_REF@[44; 47) | ||
42 | IDENT@[44; 47) "f32" | ||
43 | COMMA@[47; 48) | ||
44 | WHITESPACE@[48; 49) | ||
45 | R_CURLY@[49; 50) | ||
46 | WHITESPACE@[50; 51) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0069_use_tree_list_after_path.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0069_use_tree_list_after_path.rs new file mode 100644 index 000000000..c0a3d634e --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0069_use_tree_list_after_path.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | use crate::{Item}; | ||
2 | use self::{Item}; | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0069_use_tree_list_after_path.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0069_use_tree_list_after_path.txt new file mode 100644 index 000000000..cac746e5b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0069_use_tree_list_after_path.txt | |||
@@ -0,0 +1,37 @@ | |||
1 | SOURCE_FILE@[0; 37) | ||
2 | USE_ITEM@[0; 18) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 17) | ||
6 | PATH@[4; 9) | ||
7 | PATH_SEGMENT@[4; 9) | ||
8 | CRATE_KW@[4; 9) | ||
9 | COLONCOLON@[9; 11) | ||
10 | USE_TREE_LIST@[11; 17) | ||
11 | L_CURLY@[11; 12) | ||
12 | USE_TREE@[12; 16) | ||
13 | PATH@[12; 16) | ||
14 | PATH_SEGMENT@[12; 16) | ||
15 | NAME_REF@[12; 16) | ||
16 | IDENT@[12; 16) "Item" | ||
17 | R_CURLY@[16; 17) | ||
18 | SEMI@[17; 18) | ||
19 | WHITESPACE@[18; 19) | ||
20 | USE_ITEM@[19; 36) | ||
21 | USE_KW@[19; 22) | ||
22 | WHITESPACE@[22; 23) | ||
23 | USE_TREE@[23; 35) | ||
24 | PATH@[23; 27) | ||
25 | PATH_SEGMENT@[23; 27) | ||
26 | SELF_KW@[23; 27) | ||
27 | COLONCOLON@[27; 29) | ||
28 | USE_TREE_LIST@[29; 35) | ||
29 | L_CURLY@[29; 30) | ||
30 | USE_TREE@[30; 34) | ||
31 | PATH@[30; 34) | ||
32 | PATH_SEGMENT@[30; 34) | ||
33 | NAME_REF@[30; 34) | ||
34 | IDENT@[30; 34) "Item" | ||
35 | R_CURLY@[34; 35) | ||
36 | SEMI@[35; 36) | ||
37 | WHITESPACE@[36; 37) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs new file mode 100644 index 000000000..37b843742 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = {1} & 2; | ||
3 | {1} &2; | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt new file mode 100644 index 000000000..d8c599537 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt | |||
@@ -0,0 +1,52 @@ | |||
1 | SOURCE_FILE@[0; 46) | ||
2 | FN_DEF@[0; 45) | ||
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@[9; 45) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 31) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | BIN_EXPR@[23; 30) | ||
23 | BLOCK_EXPR@[23; 26) | ||
24 | BLOCK@[23; 26) | ||
25 | L_CURLY@[23; 24) | ||
26 | LITERAL@[24; 25) | ||
27 | INT_NUMBER@[24; 25) "1" | ||
28 | R_CURLY@[25; 26) | ||
29 | WHITESPACE@[26; 27) | ||
30 | AMP@[27; 28) | ||
31 | WHITESPACE@[28; 29) | ||
32 | LITERAL@[29; 30) | ||
33 | INT_NUMBER@[29; 30) "2" | ||
34 | SEMI@[30; 31) | ||
35 | WHITESPACE@[31; 36) | ||
36 | EXPR_STMT@[36; 39) | ||
37 | BLOCK_EXPR@[36; 39) | ||
38 | BLOCK@[36; 39) | ||
39 | L_CURLY@[36; 37) | ||
40 | LITERAL@[37; 38) | ||
41 | INT_NUMBER@[37; 38) "1" | ||
42 | R_CURLY@[38; 39) | ||
43 | WHITESPACE@[39; 40) | ||
44 | EXPR_STMT@[40; 43) | ||
45 | REF_EXPR@[40; 42) | ||
46 | AMP@[40; 41) | ||
47 | LITERAL@[41; 42) | ||
48 | INT_NUMBER@[41; 42) "2" | ||
49 | SEMI@[42; 43) | ||
50 | WHITESPACE@[43; 44) | ||
51 | R_CURLY@[44; 45) | ||
52 | WHITESPACE@[45; 46) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0071_match_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0071_match_expr.rs new file mode 100644 index 000000000..c9205dfa3 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0071_match_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | match () { }; | ||
3 | match S {}; | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0071_match_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0071_match_expr.txt new file mode 100644 index 000000000..cc22bd3b2 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0071_match_expr.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | SOURCE_FILE@[0; 47) | ||
2 | FN_DEF@[0; 46) | ||
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@[9; 46) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 28) | ||
15 | MATCH_EXPR@[15; 27) | ||
16 | MATCH_KW@[15; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | TUPLE_EXPR@[21; 23) | ||
19 | L_PAREN@[21; 22) | ||
20 | R_PAREN@[22; 23) | ||
21 | WHITESPACE@[23; 24) | ||
22 | MATCH_ARM_LIST@[24; 27) | ||
23 | L_CURLY@[24; 25) | ||
24 | WHITESPACE@[25; 26) | ||
25 | R_CURLY@[26; 27) | ||
26 | SEMI@[27; 28) | ||
27 | WHITESPACE@[28; 33) | ||
28 | EXPR_STMT@[33; 44) | ||
29 | MATCH_EXPR@[33; 43) | ||
30 | MATCH_KW@[33; 38) | ||
31 | WHITESPACE@[38; 39) | ||
32 | PATH_EXPR@[39; 40) | ||
33 | PATH@[39; 40) | ||
34 | PATH_SEGMENT@[39; 40) | ||
35 | NAME_REF@[39; 40) | ||
36 | IDENT@[39; 40) "S" | ||
37 | WHITESPACE@[40; 41) | ||
38 | MATCH_ARM_LIST@[41; 43) | ||
39 | L_CURLY@[41; 42) | ||
40 | R_CURLY@[42; 43) | ||
41 | SEMI@[43; 44) | ||
42 | WHITESPACE@[44; 45) | ||
43 | R_CURLY@[45; 46) | ||
44 | WHITESPACE@[46; 47) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0072_return_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0072_return_expr.rs new file mode 100644 index 000000000..5733666b6 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0072_return_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | return; | ||
3 | return 92; | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0072_return_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0072_return_expr.txt new file mode 100644 index 000000000..f8d1db41c --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0072_return_expr.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | SOURCE_FILE@[0; 40) | ||
2 | FN_DEF@[0; 39) | ||
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@[9; 39) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 22) | ||
15 | RETURN_EXPR@[15; 21) | ||
16 | RETURN_KW@[15; 21) | ||
17 | SEMI@[21; 22) | ||
18 | WHITESPACE@[22; 27) | ||
19 | EXPR_STMT@[27; 37) | ||
20 | RETURN_EXPR@[27; 36) | ||
21 | RETURN_KW@[27; 33) | ||
22 | WHITESPACE@[33; 34) | ||
23 | LITERAL@[34; 36) | ||
24 | INT_NUMBER@[34; 36) "92" | ||
25 | SEMI@[36; 37) | ||
26 | WHITESPACE@[37; 38) | ||
27 | R_CURLY@[38; 39) | ||
28 | WHITESPACE@[39; 40) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.rs new file mode 100644 index 000000000..defd110c4 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.rs | |||
@@ -0,0 +1 @@ | |||
type Result<T> = (); | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.txt new file mode 100644 index 000000000..89b34d4f1 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | TYPE_DEF@[0; 20) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 11) | ||
6 | IDENT@[5; 11) "Result" | ||
7 | TYPE_PARAM_LIST@[11; 14) | ||
8 | L_ANGLE@[11; 12) | ||
9 | TYPE_PARAM@[12; 13) | ||
10 | NAME@[12; 13) | ||
11 | IDENT@[12; 13) "T" | ||
12 | R_ANGLE@[13; 14) | ||
13 | WHITESPACE@[14; 15) | ||
14 | EQ@[15; 16) | ||
15 | WHITESPACE@[16; 17) | ||
16 | TUPLE_TYPE@[17; 19) | ||
17 | L_PAREN@[17; 18) | ||
18 | R_PAREN@[18; 19) | ||
19 | SEMI@[19; 20) | ||
20 | WHITESPACE@[20; 21) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs new file mode 100644 index 000000000..2edd578f9 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => {} | ||
4 | () => {} | ||
5 | [] => {} | ||
6 | } | ||
7 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt new file mode 100644 index 000000000..48e0026af --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | SOURCE_FILE@[0; 84) | ||
2 | FN_DEF@[0; 83) | ||
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@[9; 83) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | MATCH_EXPR@[15; 81) | ||
15 | MATCH_KW@[15; 20) | ||
16 | WHITESPACE@[20; 21) | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) | ||
19 | R_PAREN@[22; 23) | ||
20 | WHITESPACE@[23; 24) | ||
21 | MATCH_ARM_LIST@[24; 81) | ||
22 | L_CURLY@[24; 25) | ||
23 | WHITESPACE@[25; 34) | ||
24 | MATCH_ARM@[34; 41) | ||
25 | PLACEHOLDER_PAT@[34; 35) | ||
26 | UNDERSCORE@[34; 35) | ||
27 | WHITESPACE@[35; 36) | ||
28 | FAT_ARROW@[36; 38) | ||
29 | WHITESPACE@[38; 39) | ||
30 | BLOCK_EXPR@[39; 41) | ||
31 | BLOCK@[39; 41) | ||
32 | L_CURLY@[39; 40) | ||
33 | R_CURLY@[40; 41) | ||
34 | WHITESPACE@[41; 50) | ||
35 | MATCH_ARM@[50; 58) | ||
36 | TUPLE_PAT@[50; 52) | ||
37 | L_PAREN@[50; 51) | ||
38 | R_PAREN@[51; 52) | ||
39 | WHITESPACE@[52; 53) | ||
40 | FAT_ARROW@[53; 55) | ||
41 | WHITESPACE@[55; 56) | ||
42 | BLOCK_EXPR@[56; 58) | ||
43 | BLOCK@[56; 58) | ||
44 | L_CURLY@[56; 57) | ||
45 | R_CURLY@[57; 58) | ||
46 | WHITESPACE@[58; 67) | ||
47 | MATCH_ARM@[67; 75) | ||
48 | SLICE_PAT@[67; 69) | ||
49 | L_BRACK@[67; 68) | ||
50 | R_BRACK@[68; 69) | ||
51 | WHITESPACE@[69; 70) | ||
52 | FAT_ARROW@[70; 72) | ||
53 | WHITESPACE@[72; 73) | ||
54 | BLOCK_EXPR@[73; 75) | ||
55 | BLOCK@[73; 75) | ||
56 | L_CURLY@[73; 74) | ||
57 | R_CURLY@[74; 75) | ||
58 | WHITESPACE@[75; 80) | ||
59 | R_CURLY@[80; 81) | ||
60 | WHITESPACE@[81; 82) | ||
61 | R_CURLY@[82; 83) | ||
62 | WHITESPACE@[83; 84) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0075_block.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0075_block.rs new file mode 100644 index 000000000..81f44c533 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0075_block.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn a() {} | ||
2 | fn b() { let _ = 1; } | ||
3 | fn c() { 1; 2; } | ||
4 | fn d() { 1; 2 } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0075_block.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0075_block.txt new file mode 100644 index 000000000..c13e22b3a --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0075_block.txt | |||
@@ -0,0 +1,86 @@ | |||
1 | SOURCE_FILE@[0; 65) | ||
2 | FN_DEF@[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@[7; 9) | ||
12 | L_CURLY@[7; 8) | ||
13 | R_CURLY@[8; 9) | ||
14 | WHITESPACE@[9; 10) | ||
15 | FN_DEF@[10; 31) | ||
16 | FN_KW@[10; 12) | ||
17 | WHITESPACE@[12; 13) | ||
18 | NAME@[13; 14) | ||
19 | IDENT@[13; 14) "b" | ||
20 | PARAM_LIST@[14; 16) | ||
21 | L_PAREN@[14; 15) | ||
22 | R_PAREN@[15; 16) | ||
23 | WHITESPACE@[16; 17) | ||
24 | BLOCK@[17; 31) | ||
25 | L_CURLY@[17; 18) | ||
26 | WHITESPACE@[18; 19) | ||
27 | LET_STMT@[19; 29) | ||
28 | LET_KW@[19; 22) | ||
29 | WHITESPACE@[22; 23) | ||
30 | PLACEHOLDER_PAT@[23; 24) | ||
31 | UNDERSCORE@[23; 24) | ||
32 | WHITESPACE@[24; 25) | ||
33 | EQ@[25; 26) | ||
34 | WHITESPACE@[26; 27) | ||
35 | LITERAL@[27; 28) | ||
36 | INT_NUMBER@[27; 28) "1" | ||
37 | SEMI@[28; 29) | ||
38 | WHITESPACE@[29; 30) | ||
39 | R_CURLY@[30; 31) | ||
40 | WHITESPACE@[31; 32) | ||
41 | FN_DEF@[32; 48) | ||
42 | FN_KW@[32; 34) | ||
43 | WHITESPACE@[34; 35) | ||
44 | NAME@[35; 36) | ||
45 | IDENT@[35; 36) "c" | ||
46 | PARAM_LIST@[36; 38) | ||
47 | L_PAREN@[36; 37) | ||
48 | R_PAREN@[37; 38) | ||
49 | WHITESPACE@[38; 39) | ||
50 | BLOCK@[39; 48) | ||
51 | L_CURLY@[39; 40) | ||
52 | WHITESPACE@[40; 41) | ||
53 | EXPR_STMT@[41; 43) | ||
54 | LITERAL@[41; 42) | ||
55 | INT_NUMBER@[41; 42) "1" | ||
56 | SEMI@[42; 43) | ||
57 | WHITESPACE@[43; 44) | ||
58 | EXPR_STMT@[44; 46) | ||
59 | LITERAL@[44; 45) | ||
60 | INT_NUMBER@[44; 45) "2" | ||
61 | SEMI@[45; 46) | ||
62 | WHITESPACE@[46; 47) | ||
63 | R_CURLY@[47; 48) | ||
64 | WHITESPACE@[48; 49) | ||
65 | FN_DEF@[49; 64) | ||
66 | FN_KW@[49; 51) | ||
67 | WHITESPACE@[51; 52) | ||
68 | NAME@[52; 53) | ||
69 | IDENT@[52; 53) "d" | ||
70 | PARAM_LIST@[53; 55) | ||
71 | L_PAREN@[53; 54) | ||
72 | R_PAREN@[54; 55) | ||
73 | WHITESPACE@[55; 56) | ||
74 | BLOCK@[56; 64) | ||
75 | L_CURLY@[56; 57) | ||
76 | WHITESPACE@[57; 58) | ||
77 | EXPR_STMT@[58; 60) | ||
78 | LITERAL@[58; 59) | ||
79 | INT_NUMBER@[58; 59) "1" | ||
80 | SEMI@[59; 60) | ||
81 | WHITESPACE@[60; 61) | ||
82 | LITERAL@[61; 62) | ||
83 | INT_NUMBER@[61; 62) "2" | ||
84 | WHITESPACE@[62; 63) | ||
85 | R_CURLY@[63; 64) | ||
86 | WHITESPACE@[64; 65) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0076_function_where_clause.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0076_function_where_clause.rs new file mode 100644 index 000000000..f0920b2a8 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0076_function_where_clause.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<T>() where T: Copy {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0076_function_where_clause.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0076_function_where_clause.txt new file mode 100644 index 000000000..b58d09e35 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0076_function_where_clause.txt | |||
@@ -0,0 +1,37 @@ | |||
1 | SOURCE_FILE@[0; 29) | ||
2 | FN_DEF@[0; 28) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | TYPE_PARAM_LIST@[6; 9) | ||
8 | L_ANGLE@[6; 7) | ||
9 | TYPE_PARAM@[7; 8) | ||
10 | NAME@[7; 8) | ||
11 | IDENT@[7; 8) "T" | ||
12 | R_ANGLE@[8; 9) | ||
13 | PARAM_LIST@[9; 11) | ||
14 | L_PAREN@[9; 10) | ||
15 | R_PAREN@[10; 11) | ||
16 | WHITESPACE@[11; 12) | ||
17 | WHERE_CLAUSE@[12; 25) | ||
18 | WHERE_KW@[12; 17) | ||
19 | WHITESPACE@[17; 18) | ||
20 | WHERE_PRED@[18; 25) | ||
21 | PATH_TYPE@[18; 19) | ||
22 | PATH@[18; 19) | ||
23 | PATH_SEGMENT@[18; 19) | ||
24 | NAME_REF@[18; 19) | ||
25 | IDENT@[18; 19) "T" | ||
26 | COLON@[19; 20) | ||
27 | WHITESPACE@[20; 21) | ||
28 | PATH_TYPE@[21; 25) | ||
29 | PATH@[21; 25) | ||
30 | PATH_SEGMENT@[21; 25) | ||
31 | NAME_REF@[21; 25) | ||
32 | IDENT@[21; 25) "Copy" | ||
33 | WHITESPACE@[25; 26) | ||
34 | BLOCK@[26; 28) | ||
35 | L_CURLY@[26; 27) | ||
36 | R_CURLY@[27; 28) | ||
37 | WHITESPACE@[28; 29) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0077_try_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0077_try_expr.rs new file mode 100644 index 000000000..8b74f7bc8 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0077_try_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | x?; | ||
3 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0077_try_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0077_try_expr.txt new file mode 100644 index 000000000..f47e6da55 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0077_try_expr.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | FN_DEF@[0; 20) | ||
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@[9; 20) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 18) | ||
15 | TRY_EXPR@[15; 17) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | QUESTION@[16; 17) | ||
22 | SEMI@[17; 18) | ||
23 | WHITESPACE@[18; 19) | ||
24 | R_CURLY@[19; 20) | ||
25 | WHITESPACE@[20; 21) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.rs new file mode 100644 index 000000000..04c0344fa --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.rs | |||
@@ -0,0 +1 @@ | |||
type Foo = Bar; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.txt new file mode 100644 index 000000000..4b66a05a6 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 16) | ||
2 | TYPE_DEF@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 8) | ||
6 | IDENT@[5; 8) "Foo" | ||
7 | WHITESPACE@[8; 9) | ||
8 | EQ@[9; 10) | ||
9 | WHITESPACE@[10; 11) | ||
10 | PATH_TYPE@[11; 14) | ||
11 | PATH@[11; 14) | ||
12 | PATH_SEGMENT@[11; 14) | ||
13 | NAME_REF@[11; 14) | ||
14 | IDENT@[11; 14) "Bar" | ||
15 | SEMI@[14; 15) | ||
16 | WHITESPACE@[15; 16) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0079_impl_item.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0079_impl_item.rs new file mode 100644 index 000000000..d6337f6b3 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0079_impl_item.rs | |||
@@ -0,0 +1 @@ | |||
impl Foo {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0079_impl_item.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0079_impl_item.txt new file mode 100644 index 000000000..1b9a8aa0e --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0079_impl_item.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | SOURCE_FILE@[0; 12) | ||
2 | IMPL_ITEM@[0; 11) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | PATH_TYPE@[5; 8) | ||
6 | PATH@[5; 8) | ||
7 | PATH_SEGMENT@[5; 8) | ||
8 | NAME_REF@[5; 8) | ||
9 | IDENT@[5; 8) "Foo" | ||
10 | WHITESPACE@[8; 9) | ||
11 | ITEM_LIST@[9; 11) | ||
12 | L_CURLY@[9; 10) | ||
13 | R_CURLY@[10; 11) | ||
14 | WHITESPACE@[11; 12) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0080_postfix_range.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0080_postfix_range.rs new file mode 100644 index 000000000..c39fe8e68 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0080_postfix_range.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { let x = 1..; } | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0080_postfix_range.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0080_postfix_range.txt new file mode 100644 index 000000000..415ff2a20 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0080_postfix_range.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | SOURCE_FILE@[0; 26) | ||
2 | FN_DEF@[0; 25) | ||
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@[9; 25) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | LET_STMT@[11; 23) | ||
15 | LET_KW@[11; 14) | ||
16 | WHITESPACE@[14; 15) | ||
17 | BIND_PAT@[15; 16) | ||
18 | NAME@[15; 16) | ||
19 | IDENT@[15; 16) "x" | ||
20 | WHITESPACE@[16; 17) | ||
21 | EQ@[17; 18) | ||
22 | WHITESPACE@[18; 19) | ||
23 | RANGE_EXPR@[19; 22) | ||
24 | LITERAL@[19; 20) | ||
25 | INT_NUMBER@[19; 20) "1" | ||
26 | DOTDOT@[20; 22) | ||
27 | SEMI@[22; 23) | ||
28 | WHITESPACE@[23; 24) | ||
29 | R_CURLY@[24; 25) | ||
30 | WHITESPACE@[25; 26) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.rs new file mode 100644 index 000000000..4d6a18c6b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.rs | |||
@@ -0,0 +1 @@ | |||
type A = for<'a> fn() -> (); | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.txt new file mode 100644 index 000000000..843cc4973 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | SOURCE_FILE@[0; 29) | ||
2 | TYPE_DEF@[0; 28) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | FOR_TYPE@[9; 27) | ||
11 | FOR_KW@[9; 12) | ||
12 | TYPE_PARAM_LIST@[12; 16) | ||
13 | L_ANGLE@[12; 13) | ||
14 | LIFETIME_PARAM@[13; 15) | ||
15 | LIFETIME@[13; 15) "'a" | ||
16 | R_ANGLE@[15; 16) | ||
17 | WHITESPACE@[16; 17) | ||
18 | FN_POINTER_TYPE@[17; 27) | ||
19 | FN_KW@[17; 19) | ||
20 | PARAM_LIST@[19; 21) | ||
21 | L_PAREN@[19; 20) | ||
22 | R_PAREN@[20; 21) | ||
23 | WHITESPACE@[21; 22) | ||
24 | RET_TYPE@[22; 27) | ||
25 | THIN_ARROW@[22; 24) | ||
26 | WHITESPACE@[24; 25) | ||
27 | TUPLE_TYPE@[25; 27) | ||
28 | L_PAREN@[25; 26) | ||
29 | R_PAREN@[26; 27) | ||
30 | SEMI@[27; 28) | ||
31 | WHITESPACE@[28; 29) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0082_ref_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0082_ref_expr.rs new file mode 100644 index 000000000..2dac6be95 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0082_ref_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = &1; | ||
3 | let _ = &mut &f(); | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0082_ref_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0082_ref_expr.txt new file mode 100644 index 000000000..2cd888762 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0082_ref_expr.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | SOURCE_FILE@[0; 52) | ||
2 | FN_DEF@[0; 51) | ||
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@[9; 51) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 26) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | REF_EXPR@[23; 25) | ||
23 | AMP@[23; 24) | ||
24 | LITERAL@[24; 25) | ||
25 | INT_NUMBER@[24; 25) "1" | ||
26 | SEMI@[25; 26) | ||
27 | WHITESPACE@[26; 31) | ||
28 | LET_STMT@[31; 49) | ||
29 | LET_KW@[31; 34) | ||
30 | WHITESPACE@[34; 35) | ||
31 | PLACEHOLDER_PAT@[35; 36) | ||
32 | UNDERSCORE@[35; 36) | ||
33 | WHITESPACE@[36; 37) | ||
34 | EQ@[37; 38) | ||
35 | WHITESPACE@[38; 39) | ||
36 | REF_EXPR@[39; 48) | ||
37 | AMP@[39; 40) | ||
38 | MUT_KW@[40; 43) | ||
39 | WHITESPACE@[43; 44) | ||
40 | REF_EXPR@[44; 48) | ||
41 | AMP@[44; 45) | ||
42 | CALL_EXPR@[45; 48) | ||
43 | PATH_EXPR@[45; 46) | ||
44 | PATH@[45; 46) | ||
45 | PATH_SEGMENT@[45; 46) | ||
46 | NAME_REF@[45; 46) | ||
47 | IDENT@[45; 46) "f" | ||
48 | ARG_LIST@[46; 48) | ||
49 | L_PAREN@[46; 47) | ||
50 | R_PAREN@[47; 48) | ||
51 | SEMI@[48; 49) | ||
52 | WHITESPACE@[49; 50) | ||
53 | R_CURLY@[50; 51) | ||
54 | WHITESPACE@[51; 52) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0083_struct_items.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0083_struct_items.rs new file mode 100644 index 000000000..693e3f3ee --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0083_struct_items.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | struct Foo; | ||
2 | struct Foo {} | ||
3 | struct Foo(); | ||
4 | struct Foo(String, usize); | ||
5 | struct Foo { | ||
6 | a: i32, | ||
7 | b: f32, | ||
8 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0083_struct_items.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0083_struct_items.txt new file mode 100644 index 000000000..058639375 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0083_struct_items.txt | |||
@@ -0,0 +1,87 @@ | |||
1 | SOURCE_FILE@[0; 106) | ||
2 | STRUCT_DEF@[0; 11) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 10) | ||
6 | IDENT@[7; 10) "Foo" | ||
7 | SEMI@[10; 11) | ||
8 | WHITESPACE@[11; 12) | ||
9 | STRUCT_DEF@[12; 25) | ||
10 | STRUCT_KW@[12; 18) | ||
11 | WHITESPACE@[18; 19) | ||
12 | NAME@[19; 22) | ||
13 | IDENT@[19; 22) "Foo" | ||
14 | WHITESPACE@[22; 23) | ||
15 | NAMED_FIELD_DEF_LIST@[23; 25) | ||
16 | L_CURLY@[23; 24) | ||
17 | R_CURLY@[24; 25) | ||
18 | WHITESPACE@[25; 26) | ||
19 | STRUCT_DEF@[26; 39) | ||
20 | STRUCT_KW@[26; 32) | ||
21 | WHITESPACE@[32; 33) | ||
22 | NAME@[33; 36) | ||
23 | IDENT@[33; 36) "Foo" | ||
24 | POS_FIELD_LIST@[36; 38) | ||
25 | L_PAREN@[36; 37) | ||
26 | R_PAREN@[37; 38) | ||
27 | SEMI@[38; 39) | ||
28 | WHITESPACE@[39; 40) | ||
29 | STRUCT_DEF@[40; 66) | ||
30 | STRUCT_KW@[40; 46) | ||
31 | WHITESPACE@[46; 47) | ||
32 | NAME@[47; 50) | ||
33 | IDENT@[47; 50) "Foo" | ||
34 | POS_FIELD_LIST@[50; 65) | ||
35 | L_PAREN@[50; 51) | ||
36 | POS_FIELD@[51; 57) | ||
37 | PATH_TYPE@[51; 57) | ||
38 | PATH@[51; 57) | ||
39 | PATH_SEGMENT@[51; 57) | ||
40 | NAME_REF@[51; 57) | ||
41 | IDENT@[51; 57) "String" | ||
42 | COMMA@[57; 58) | ||
43 | WHITESPACE@[58; 59) | ||
44 | POS_FIELD@[59; 64) | ||
45 | PATH_TYPE@[59; 64) | ||
46 | PATH@[59; 64) | ||
47 | PATH_SEGMENT@[59; 64) | ||
48 | NAME_REF@[59; 64) | ||
49 | IDENT@[59; 64) "usize" | ||
50 | R_PAREN@[64; 65) | ||
51 | SEMI@[65; 66) | ||
52 | WHITESPACE@[66; 67) | ||
53 | STRUCT_DEF@[67; 105) | ||
54 | STRUCT_KW@[67; 73) | ||
55 | WHITESPACE@[73; 74) | ||
56 | NAME@[74; 77) | ||
57 | IDENT@[74; 77) "Foo" | ||
58 | WHITESPACE@[77; 78) | ||
59 | NAMED_FIELD_DEF_LIST@[78; 105) | ||
60 | L_CURLY@[78; 79) | ||
61 | WHITESPACE@[79; 84) | ||
62 | NAMED_FIELD_DEF@[84; 90) | ||
63 | NAME@[84; 85) | ||
64 | IDENT@[84; 85) "a" | ||
65 | COLON@[85; 86) | ||
66 | WHITESPACE@[86; 87) | ||
67 | PATH_TYPE@[87; 90) | ||
68 | PATH@[87; 90) | ||
69 | PATH_SEGMENT@[87; 90) | ||
70 | NAME_REF@[87; 90) | ||
71 | IDENT@[87; 90) "i32" | ||
72 | COMMA@[90; 91) | ||
73 | WHITESPACE@[91; 96) | ||
74 | NAMED_FIELD_DEF@[96; 102) | ||
75 | NAME@[96; 97) | ||
76 | IDENT@[96; 97) "b" | ||
77 | COLON@[97; 98) | ||
78 | WHITESPACE@[98; 99) | ||
79 | PATH_TYPE@[99; 102) | ||
80 | PATH@[99; 102) | ||
81 | PATH_SEGMENT@[99; 102) | ||
82 | NAME_REF@[99; 102) | ||
83 | IDENT@[99; 102) "f32" | ||
84 | COMMA@[102; 103) | ||
85 | WHITESPACE@[103; 104) | ||
86 | R_CURLY@[104; 105) | ||
87 | WHITESPACE@[105; 106) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.rs new file mode 100644 index 000000000..6e1b25101 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (i32); | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.txt new file mode 100644 index 000000000..bd5feb6b3 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | SOURCE_FILE@[0; 16) | ||
2 | TYPE_DEF@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PAREN_TYPE@[9; 14) | ||
11 | L_PAREN@[9; 10) | ||
12 | PATH_TYPE@[10; 13) | ||
13 | PATH@[10; 13) | ||
14 | PATH_SEGMENT@[10; 13) | ||
15 | NAME_REF@[10; 13) | ||
16 | IDENT@[10; 13) "i32" | ||
17 | R_PAREN@[13; 14) | ||
18 | SEMI@[14; 15) | ||
19 | WHITESPACE@[15; 16) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0085_expr_literals.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0085_expr_literals.rs new file mode 100644 index 000000000..2e11a5a6e --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0085_expr_literals.rs | |||
@@ -0,0 +1,12 @@ | |||
1 | fn foo() { | ||
2 | let _ = true; | ||
3 | let _ = false; | ||
4 | let _ = 1; | ||
5 | let _ = 2.0; | ||
6 | let _ = b'a'; | ||
7 | let _ = 'b'; | ||
8 | let _ = "c"; | ||
9 | let _ = r"d"; | ||
10 | let _ = b"e"; | ||
11 | let _ = br"f"; | ||
12 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0085_expr_literals.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0085_expr_literals.txt new file mode 100644 index 000000000..1d88f952d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0085_expr_literals.txt | |||
@@ -0,0 +1,135 @@ | |||
1 | SOURCE_FILE@[0; 189) | ||
2 | FN_DEF@[0; 188) | ||
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@[9; 188) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 28) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | LITERAL@[23; 27) | ||
23 | TRUE_KW@[23; 27) | ||
24 | SEMI@[27; 28) | ||
25 | WHITESPACE@[28; 33) | ||
26 | LET_STMT@[33; 47) | ||
27 | LET_KW@[33; 36) | ||
28 | WHITESPACE@[36; 37) | ||
29 | PLACEHOLDER_PAT@[37; 38) | ||
30 | UNDERSCORE@[37; 38) | ||
31 | WHITESPACE@[38; 39) | ||
32 | EQ@[39; 40) | ||
33 | WHITESPACE@[40; 41) | ||
34 | LITERAL@[41; 46) | ||
35 | FALSE_KW@[41; 46) | ||
36 | SEMI@[46; 47) | ||
37 | WHITESPACE@[47; 52) | ||
38 | LET_STMT@[52; 62) | ||
39 | LET_KW@[52; 55) | ||
40 | WHITESPACE@[55; 56) | ||
41 | PLACEHOLDER_PAT@[56; 57) | ||
42 | UNDERSCORE@[56; 57) | ||
43 | WHITESPACE@[57; 58) | ||
44 | EQ@[58; 59) | ||
45 | WHITESPACE@[59; 60) | ||
46 | LITERAL@[60; 61) | ||
47 | INT_NUMBER@[60; 61) "1" | ||
48 | SEMI@[61; 62) | ||
49 | WHITESPACE@[62; 67) | ||
50 | LET_STMT@[67; 79) | ||
51 | LET_KW@[67; 70) | ||
52 | WHITESPACE@[70; 71) | ||
53 | PLACEHOLDER_PAT@[71; 72) | ||
54 | UNDERSCORE@[71; 72) | ||
55 | WHITESPACE@[72; 73) | ||
56 | EQ@[73; 74) | ||
57 | WHITESPACE@[74; 75) | ||
58 | LITERAL@[75; 78) | ||
59 | FLOAT_NUMBER@[75; 78) "2.0" | ||
60 | SEMI@[78; 79) | ||
61 | WHITESPACE@[79; 84) | ||
62 | LET_STMT@[84; 97) | ||
63 | LET_KW@[84; 87) | ||
64 | WHITESPACE@[87; 88) | ||
65 | PLACEHOLDER_PAT@[88; 89) | ||
66 | UNDERSCORE@[88; 89) | ||
67 | WHITESPACE@[89; 90) | ||
68 | EQ@[90; 91) | ||
69 | WHITESPACE@[91; 92) | ||
70 | LITERAL@[92; 96) | ||
71 | BYTE@[92; 96) | ||
72 | SEMI@[96; 97) | ||
73 | WHITESPACE@[97; 102) | ||
74 | LET_STMT@[102; 114) | ||
75 | LET_KW@[102; 105) | ||
76 | WHITESPACE@[105; 106) | ||
77 | PLACEHOLDER_PAT@[106; 107) | ||
78 | UNDERSCORE@[106; 107) | ||
79 | WHITESPACE@[107; 108) | ||
80 | EQ@[108; 109) | ||
81 | WHITESPACE@[109; 110) | ||
82 | LITERAL@[110; 113) | ||
83 | CHAR@[110; 113) | ||
84 | SEMI@[113; 114) | ||
85 | WHITESPACE@[114; 119) | ||
86 | LET_STMT@[119; 131) | ||
87 | LET_KW@[119; 122) | ||
88 | WHITESPACE@[122; 123) | ||
89 | PLACEHOLDER_PAT@[123; 124) | ||
90 | UNDERSCORE@[123; 124) | ||
91 | WHITESPACE@[124; 125) | ||
92 | EQ@[125; 126) | ||
93 | WHITESPACE@[126; 127) | ||
94 | LITERAL@[127; 130) | ||
95 | STRING@[127; 130) | ||
96 | SEMI@[130; 131) | ||
97 | WHITESPACE@[131; 136) | ||
98 | LET_STMT@[136; 149) | ||
99 | LET_KW@[136; 139) | ||
100 | WHITESPACE@[139; 140) | ||
101 | PLACEHOLDER_PAT@[140; 141) | ||
102 | UNDERSCORE@[140; 141) | ||
103 | WHITESPACE@[141; 142) | ||
104 | EQ@[142; 143) | ||
105 | WHITESPACE@[143; 144) | ||
106 | LITERAL@[144; 148) | ||
107 | RAW_STRING@[144; 148) | ||
108 | SEMI@[148; 149) | ||
109 | WHITESPACE@[149; 154) | ||
110 | LET_STMT@[154; 167) | ||
111 | LET_KW@[154; 157) | ||
112 | WHITESPACE@[157; 158) | ||
113 | PLACEHOLDER_PAT@[158; 159) | ||
114 | UNDERSCORE@[158; 159) | ||
115 | WHITESPACE@[159; 160) | ||
116 | EQ@[160; 161) | ||
117 | WHITESPACE@[161; 162) | ||
118 | LITERAL@[162; 166) | ||
119 | BYTE_STRING@[162; 166) | ||
120 | SEMI@[166; 167) | ||
121 | WHITESPACE@[167; 172) | ||
122 | LET_STMT@[172; 186) | ||
123 | LET_KW@[172; 175) | ||
124 | WHITESPACE@[175; 176) | ||
125 | PLACEHOLDER_PAT@[176; 177) | ||
126 | UNDERSCORE@[176; 177) | ||
127 | WHITESPACE@[177; 178) | ||
128 | EQ@[178; 179) | ||
129 | WHITESPACE@[179; 180) | ||
130 | LITERAL@[180; 185) | ||
131 | RAW_BYTE_STRING@[180; 185) | ||
132 | SEMI@[185; 186) | ||
133 | WHITESPACE@[186; 187) | ||
134 | R_CURLY@[187; 188) | ||
135 | WHITESPACE@[188; 189) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0086_function_ret_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0086_function_ret_type.rs new file mode 100644 index 000000000..d22d8cada --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0086_function_ret_type.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | fn foo() {} | ||
2 | fn bar() -> () {} | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0086_function_ret_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0086_function_ret_type.txt new file mode 100644 index 000000000..1edf9412f --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0086_function_ret_type.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | SOURCE_FILE@[0; 30) | ||
2 | FN_DEF@[0; 11) | ||
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@[9; 11) | ||
12 | L_CURLY@[9; 10) | ||
13 | R_CURLY@[10; 11) | ||
14 | WHITESPACE@[11; 12) | ||
15 | FN_DEF@[12; 29) | ||
16 | FN_KW@[12; 14) | ||
17 | WHITESPACE@[14; 15) | ||
18 | NAME@[15; 18) | ||
19 | IDENT@[15; 18) "bar" | ||
20 | PARAM_LIST@[18; 20) | ||
21 | L_PAREN@[18; 19) | ||
22 | R_PAREN@[19; 20) | ||
23 | WHITESPACE@[20; 21) | ||
24 | RET_TYPE@[21; 26) | ||
25 | THIN_ARROW@[21; 23) | ||
26 | WHITESPACE@[23; 24) | ||
27 | TUPLE_TYPE@[24; 26) | ||
28 | L_PAREN@[24; 25) | ||
29 | R_PAREN@[25; 26) | ||
30 | WHITESPACE@[26; 27) | ||
31 | BLOCK@[27; 29) | ||
32 | L_CURLY@[27; 28) | ||
33 | R_CURLY@[28; 29) | ||
34 | WHITESPACE@[29; 30) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0087_unsafe_impl.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0087_unsafe_impl.rs new file mode 100644 index 000000000..41055f41d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0087_unsafe_impl.rs | |||
@@ -0,0 +1 @@ | |||
unsafe impl Foo {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0087_unsafe_impl.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0087_unsafe_impl.txt new file mode 100644 index 000000000..f9c96c242 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0087_unsafe_impl.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 19) | ||
2 | IMPL_ITEM@[0; 18) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | IMPL_KW@[7; 11) | ||
6 | WHITESPACE@[11; 12) | ||
7 | PATH_TYPE@[12; 15) | ||
8 | PATH@[12; 15) | ||
9 | PATH_SEGMENT@[12; 15) | ||
10 | NAME_REF@[12; 15) | ||
11 | IDENT@[12; 15) "Foo" | ||
12 | WHITESPACE@[15; 16) | ||
13 | ITEM_LIST@[16; 18) | ||
14 | L_CURLY@[16; 17) | ||
15 | R_CURLY@[17; 18) | ||
16 | WHITESPACE@[18; 19) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0088_break_ambiguity.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0088_break_ambiguity.rs new file mode 100644 index 000000000..560eb05b9 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0088_break_ambiguity.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo(){ | ||
2 | if break {} | ||
3 | while break {} | ||
4 | for i in break {} | ||
5 | match break {} | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0088_break_ambiguity.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0088_break_ambiguity.txt new file mode 100644 index 000000000..6032a6c17 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0088_break_ambiguity.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | SOURCE_FILE@[0; 88) | ||
2 | FN_DEF@[0; 87) | ||
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 | BLOCK@[8; 87) | ||
11 | L_CURLY@[8; 9) | ||
12 | WHITESPACE@[9; 14) | ||
13 | EXPR_STMT@[14; 25) | ||
14 | IF_EXPR@[14; 25) | ||
15 | IF_KW@[14; 16) | ||
16 | WHITESPACE@[16; 17) | ||
17 | CONDITION@[17; 22) | ||
18 | BREAK_EXPR@[17; 22) | ||
19 | BREAK_KW@[17; 22) | ||
20 | WHITESPACE@[22; 23) | ||
21 | BLOCK@[23; 25) | ||
22 | L_CURLY@[23; 24) | ||
23 | R_CURLY@[24; 25) | ||
24 | WHITESPACE@[25; 30) | ||
25 | EXPR_STMT@[30; 44) | ||
26 | WHILE_EXPR@[30; 44) | ||
27 | WHILE_KW@[30; 35) | ||
28 | WHITESPACE@[35; 36) | ||
29 | CONDITION@[36; 41) | ||
30 | BREAK_EXPR@[36; 41) | ||
31 | BREAK_KW@[36; 41) | ||
32 | WHITESPACE@[41; 42) | ||
33 | BLOCK@[42; 44) | ||
34 | L_CURLY@[42; 43) | ||
35 | R_CURLY@[43; 44) | ||
36 | WHITESPACE@[44; 49) | ||
37 | EXPR_STMT@[49; 66) | ||
38 | FOR_EXPR@[49; 66) | ||
39 | FOR_KW@[49; 52) | ||
40 | WHITESPACE@[52; 53) | ||
41 | BIND_PAT@[53; 54) | ||
42 | NAME@[53; 54) | ||
43 | IDENT@[53; 54) "i" | ||
44 | WHITESPACE@[54; 55) | ||
45 | IN_KW@[55; 57) | ||
46 | WHITESPACE@[57; 58) | ||
47 | BREAK_EXPR@[58; 63) | ||
48 | BREAK_KW@[58; 63) | ||
49 | WHITESPACE@[63; 64) | ||
50 | BLOCK@[64; 66) | ||
51 | L_CURLY@[64; 65) | ||
52 | R_CURLY@[65; 66) | ||
53 | WHITESPACE@[66; 71) | ||
54 | MATCH_EXPR@[71; 85) | ||
55 | MATCH_KW@[71; 76) | ||
56 | WHITESPACE@[76; 77) | ||
57 | BREAK_EXPR@[77; 82) | ||
58 | BREAK_KW@[77; 82) | ||
59 | WHITESPACE@[82; 83) | ||
60 | MATCH_ARM_LIST@[83; 85) | ||
61 | L_CURLY@[83; 84) | ||
62 | R_CURLY@[84; 85) | ||
63 | WHITESPACE@[85; 86) | ||
64 | R_CURLY@[86; 87) | ||
65 | WHITESPACE@[87; 88) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0089_extern_fn.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0089_extern_fn.rs new file mode 100644 index 000000000..394a049f0 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0089_extern_fn.rs | |||
@@ -0,0 +1 @@ | |||
extern fn foo() {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0089_extern_fn.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0089_extern_fn.txt new file mode 100644 index 000000000..d2b26566d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0089_extern_fn.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | SOURCE_FILE@[0; 19) | ||
2 | FN_DEF@[0; 18) | ||
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@[16; 18) | ||
15 | L_CURLY@[16; 17) | ||
16 | R_CURLY@[17; 18) | ||
17 | WHITESPACE@[18; 19) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0090_type_param_default.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0090_type_param_default.rs new file mode 100644 index 000000000..540eacb02 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0090_type_param_default.rs | |||
@@ -0,0 +1 @@ | |||
struct S<T = i32>; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0090_type_param_default.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0090_type_param_default.txt new file mode 100644 index 000000000..59b3fbd2e --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0090_type_param_default.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | SOURCE_FILE@[0; 19) | ||
2 | STRUCT_DEF@[0; 18) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | TYPE_PARAM_LIST@[8; 17) | ||
8 | L_ANGLE@[8; 9) | ||
9 | TYPE_PARAM@[9; 16) | ||
10 | NAME@[9; 10) | ||
11 | IDENT@[9; 10) "T" | ||
12 | WHITESPACE@[10; 11) | ||
13 | EQ@[11; 12) | ||
14 | WHITESPACE@[12; 13) | ||
15 | PATH_TYPE@[13; 16) | ||
16 | PATH@[13; 16) | ||
17 | PATH_SEGMENT@[13; 16) | ||
18 | NAME_REF@[13; 16) | ||
19 | IDENT@[13; 16) "i32" | ||
20 | R_ANGLE@[16; 17) | ||
21 | SEMI@[17; 18) | ||
22 | WHITESPACE@[18; 19) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0091_auto_trait.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0091_auto_trait.rs new file mode 100644 index 000000000..72adf6035 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0091_auto_trait.rs | |||
@@ -0,0 +1 @@ | |||
auto trait T {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0091_auto_trait.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0091_auto_trait.txt new file mode 100644 index 000000000..8b3ce28d0 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0091_auto_trait.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | SOURCE_FILE@[0; 16) | ||
2 | TRAIT_DEF@[0; 15) | ||
3 | AUTO_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | TRAIT_KW@[5; 10) | ||
6 | WHITESPACE@[10; 11) | ||
7 | NAME@[11; 12) | ||
8 | IDENT@[11; 12) "T" | ||
9 | WHITESPACE@[12; 13) | ||
10 | ITEM_LIST@[13; 15) | ||
11 | L_CURLY@[13; 14) | ||
12 | R_CURLY@[14; 15) | ||
13 | WHITESPACE@[15; 16) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs new file mode 100644 index 000000000..e3ba5e87f --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs | |||
@@ -0,0 +1 @@ | |||
type F = fn() -> (); | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt new file mode 100644 index 000000000..f092c6df7 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | TYPE_DEF@[0; 20) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | FN_POINTER_TYPE@[9; 19) | ||
11 | FN_KW@[9; 11) | ||
12 | PARAM_LIST@[11; 13) | ||
13 | L_PAREN@[11; 12) | ||
14 | R_PAREN@[12; 13) | ||
15 | WHITESPACE@[13; 14) | ||
16 | RET_TYPE@[14; 19) | ||
17 | THIN_ARROW@[14; 16) | ||
18 | WHITESPACE@[16; 17) | ||
19 | TUPLE_TYPE@[17; 19) | ||
20 | L_PAREN@[17; 18) | ||
21 | R_PAREN@[18; 19) | ||
22 | SEMI@[19; 20) | ||
23 | WHITESPACE@[20; 21) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0093_index_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0093_index_expr.rs new file mode 100644 index 000000000..b9ba78a6c --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0093_index_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | x[1][2]; | ||
3 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0093_index_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0093_index_expr.txt new file mode 100644 index 000000000..6e10be559 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0093_index_expr.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | SOURCE_FILE@[0; 26) | ||
2 | FN_DEF@[0; 25) | ||
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@[9; 25) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 23) | ||
15 | INDEX_EXPR@[15; 22) | ||
16 | INDEX_EXPR@[15; 19) | ||
17 | PATH_EXPR@[15; 16) | ||
18 | PATH@[15; 16) | ||
19 | PATH_SEGMENT@[15; 16) | ||
20 | NAME_REF@[15; 16) | ||
21 | IDENT@[15; 16) "x" | ||
22 | L_BRACK@[16; 17) | ||
23 | LITERAL@[17; 18) | ||
24 | INT_NUMBER@[17; 18) "1" | ||
25 | R_BRACK@[18; 19) | ||
26 | L_BRACK@[19; 20) | ||
27 | LITERAL@[20; 21) | ||
28 | INT_NUMBER@[20; 21) "2" | ||
29 | R_BRACK@[21; 22) | ||
30 | SEMI@[22; 23) | ||
31 | WHITESPACE@[23; 24) | ||
32 | R_CURLY@[24; 25) | ||
33 | WHITESPACE@[25; 26) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0094_unsafe_auto_trait.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0094_unsafe_auto_trait.rs new file mode 100644 index 000000000..03d29f324 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0094_unsafe_auto_trait.rs | |||
@@ -0,0 +1 @@ | |||
unsafe auto trait T {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0094_unsafe_auto_trait.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0094_unsafe_auto_trait.txt new file mode 100644 index 000000000..b541ceff8 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0094_unsafe_auto_trait.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | SOURCE_FILE@[0; 23) | ||
2 | TRAIT_DEF@[0; 22) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | AUTO_KW@[7; 11) | ||
6 | WHITESPACE@[11; 12) | ||
7 | TRAIT_KW@[12; 17) | ||
8 | WHITESPACE@[17; 18) | ||
9 | NAME@[18; 19) | ||
10 | IDENT@[18; 19) "T" | ||
11 | WHITESPACE@[19; 20) | ||
12 | ITEM_LIST@[20; 22) | ||
13 | L_CURLY@[20; 21) | ||
14 | R_CURLY@[21; 22) | ||
15 | WHITESPACE@[22; 23) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0095_placeholder_pat.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0095_placeholder_pat.rs new file mode 100644 index 000000000..4d719c433 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0095_placeholder_pat.rs | |||
@@ -0,0 +1 @@ | |||
fn main() { let _ = (); } | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0095_placeholder_pat.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0095_placeholder_pat.txt new file mode 100644 index 000000000..08ba391e3 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0095_placeholder_pat.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | SOURCE_FILE@[0; 26) | ||
2 | FN_DEF@[0; 25) | ||
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@[10; 25) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 12) | ||
14 | LET_STMT@[12; 23) | ||
15 | LET_KW@[12; 15) | ||
16 | WHITESPACE@[15; 16) | ||
17 | PLACEHOLDER_PAT@[16; 17) | ||
18 | UNDERSCORE@[16; 17) | ||
19 | WHITESPACE@[17; 18) | ||
20 | EQ@[18; 19) | ||
21 | WHITESPACE@[19; 20) | ||
22 | TUPLE_EXPR@[20; 22) | ||
23 | L_PAREN@[20; 21) | ||
24 | R_PAREN@[21; 22) | ||
25 | SEMI@[22; 23) | ||
26 | WHITESPACE@[23; 24) | ||
27 | R_CURLY@[24; 25) | ||
28 | WHITESPACE@[25; 26) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0096_no_semi_after_block.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0096_no_semi_after_block.rs new file mode 100644 index 000000000..4919665cb --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0096_no_semi_after_block.rs | |||
@@ -0,0 +1,13 @@ | |||
1 | fn foo() { | ||
2 | if true {} | ||
3 | loop {} | ||
4 | match () {} | ||
5 | while true {} | ||
6 | for _ in () {} | ||
7 | {} | ||
8 | {} | ||
9 | macro_rules! test { | ||
10 | () => {} | ||
11 | } | ||
12 | test!{} | ||
13 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0096_no_semi_after_block.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0096_no_semi_after_block.txt new file mode 100644 index 000000000..63b230091 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0096_no_semi_after_block.txt | |||
@@ -0,0 +1,123 @@ | |||
1 | SOURCE_FILE@[0; 167) | ||
2 | FN_DEF@[0; 166) | ||
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@[9; 166) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 25) | ||
15 | IF_EXPR@[15; 25) | ||
16 | IF_KW@[15; 17) | ||
17 | WHITESPACE@[17; 18) | ||
18 | CONDITION@[18; 22) | ||
19 | LITERAL@[18; 22) | ||
20 | TRUE_KW@[18; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | BLOCK@[23; 25) | ||
23 | L_CURLY@[23; 24) | ||
24 | R_CURLY@[24; 25) | ||
25 | WHITESPACE@[25; 30) | ||
26 | EXPR_STMT@[30; 37) | ||
27 | LOOP_EXPR@[30; 37) | ||
28 | LOOP_KW@[30; 34) | ||
29 | WHITESPACE@[34; 35) | ||
30 | BLOCK@[35; 37) | ||
31 | L_CURLY@[35; 36) | ||
32 | R_CURLY@[36; 37) | ||
33 | WHITESPACE@[37; 42) | ||
34 | EXPR_STMT@[42; 53) | ||
35 | MATCH_EXPR@[42; 53) | ||
36 | MATCH_KW@[42; 47) | ||
37 | WHITESPACE@[47; 48) | ||
38 | TUPLE_EXPR@[48; 50) | ||
39 | L_PAREN@[48; 49) | ||
40 | R_PAREN@[49; 50) | ||
41 | WHITESPACE@[50; 51) | ||
42 | MATCH_ARM_LIST@[51; 53) | ||
43 | L_CURLY@[51; 52) | ||
44 | R_CURLY@[52; 53) | ||
45 | WHITESPACE@[53; 58) | ||
46 | EXPR_STMT@[58; 71) | ||
47 | WHILE_EXPR@[58; 71) | ||
48 | WHILE_KW@[58; 63) | ||
49 | WHITESPACE@[63; 64) | ||
50 | CONDITION@[64; 68) | ||
51 | LITERAL@[64; 68) | ||
52 | TRUE_KW@[64; 68) | ||
53 | WHITESPACE@[68; 69) | ||
54 | BLOCK@[69; 71) | ||
55 | L_CURLY@[69; 70) | ||
56 | R_CURLY@[70; 71) | ||
57 | WHITESPACE@[71; 76) | ||
58 | EXPR_STMT@[76; 90) | ||
59 | FOR_EXPR@[76; 90) | ||
60 | FOR_KW@[76; 79) | ||
61 | WHITESPACE@[79; 80) | ||
62 | PLACEHOLDER_PAT@[80; 81) | ||
63 | UNDERSCORE@[80; 81) | ||
64 | WHITESPACE@[81; 82) | ||
65 | IN_KW@[82; 84) | ||
66 | WHITESPACE@[84; 85) | ||
67 | TUPLE_EXPR@[85; 87) | ||
68 | L_PAREN@[85; 86) | ||
69 | R_PAREN@[86; 87) | ||
70 | WHITESPACE@[87; 88) | ||
71 | BLOCK@[88; 90) | ||
72 | L_CURLY@[88; 89) | ||
73 | R_CURLY@[89; 90) | ||
74 | WHITESPACE@[90; 95) | ||
75 | EXPR_STMT@[95; 97) | ||
76 | BLOCK_EXPR@[95; 97) | ||
77 | BLOCK@[95; 97) | ||
78 | L_CURLY@[95; 96) | ||
79 | R_CURLY@[96; 97) | ||
80 | WHITESPACE@[97; 102) | ||
81 | EXPR_STMT@[102; 104) | ||
82 | BLOCK_EXPR@[102; 104) | ||
83 | BLOCK@[102; 104) | ||
84 | L_CURLY@[102; 103) | ||
85 | R_CURLY@[103; 104) | ||
86 | WHITESPACE@[104; 109) | ||
87 | EXPR_STMT@[109; 152) | ||
88 | MACRO_CALL@[109; 152) | ||
89 | PATH@[109; 120) | ||
90 | PATH_SEGMENT@[109; 120) | ||
91 | NAME_REF@[109; 120) | ||
92 | IDENT@[109; 120) "macro_rules" | ||
93 | EXCL@[120; 121) | ||
94 | WHITESPACE@[121; 122) | ||
95 | IDENT@[122; 126) "test" | ||
96 | WHITESPACE@[126; 127) | ||
97 | TOKEN_TREE@[127; 152) | ||
98 | L_CURLY@[127; 128) | ||
99 | WHITESPACE@[128; 138) | ||
100 | TOKEN_TREE@[138; 140) | ||
101 | L_PAREN@[138; 139) | ||
102 | R_PAREN@[139; 140) | ||
103 | WHITESPACE@[140; 141) | ||
104 | FAT_ARROW@[141; 143) | ||
105 | WHITESPACE@[143; 144) | ||
106 | TOKEN_TREE@[144; 146) | ||
107 | L_CURLY@[144; 145) | ||
108 | R_CURLY@[145; 146) | ||
109 | WHITESPACE@[146; 151) | ||
110 | R_CURLY@[151; 152) | ||
111 | WHITESPACE@[152; 157) | ||
112 | MACRO_CALL@[157; 164) | ||
113 | PATH@[157; 161) | ||
114 | PATH_SEGMENT@[157; 161) | ||
115 | NAME_REF@[157; 161) | ||
116 | IDENT@[157; 161) "test" | ||
117 | EXCL@[161; 162) | ||
118 | TOKEN_TREE@[162; 164) | ||
119 | L_CURLY@[162; 163) | ||
120 | R_CURLY@[163; 164) | ||
121 | WHITESPACE@[164; 165) | ||
122 | R_CURLY@[165; 166) | ||
123 | WHITESPACE@[166; 167) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0097_default_impl.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0097_default_impl.rs new file mode 100644 index 000000000..ef6aa84a2 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0097_default_impl.rs | |||
@@ -0,0 +1 @@ | |||
default impl Foo {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0097_default_impl.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0097_default_impl.txt new file mode 100644 index 000000000..f45b6251f --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0097_default_impl.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 20) | ||
2 | IMPL_ITEM@[0; 19) | ||
3 | DEFAULT_KW@[0; 7) | ||
4 | WHITESPACE@[7; 8) | ||
5 | IMPL_KW@[8; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | PATH_TYPE@[13; 16) | ||
8 | PATH@[13; 16) | ||
9 | PATH_SEGMENT@[13; 16) | ||
10 | NAME_REF@[13; 16) | ||
11 | IDENT@[13; 16) "Foo" | ||
12 | WHITESPACE@[16; 17) | ||
13 | ITEM_LIST@[17; 19) | ||
14 | L_CURLY@[17; 18) | ||
15 | R_CURLY@[18; 19) | ||
16 | WHITESPACE@[19; 20) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0098_const_unsafe_fn.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0098_const_unsafe_fn.rs new file mode 100644 index 000000000..31a1e435f --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0098_const_unsafe_fn.rs | |||
@@ -0,0 +1 @@ | |||
const unsafe fn foo() {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0098_const_unsafe_fn.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0098_const_unsafe_fn.txt new file mode 100644 index 000000000..814c9f1a0 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0098_const_unsafe_fn.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | SOURCE_FILE@[0; 25) | ||
2 | FN_DEF@[0; 24) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | UNSAFE_KW@[6; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | FN_KW@[13; 15) | ||
8 | WHITESPACE@[15; 16) | ||
9 | NAME@[16; 19) | ||
10 | IDENT@[16; 19) "foo" | ||
11 | PARAM_LIST@[19; 21) | ||
12 | L_PAREN@[19; 20) | ||
13 | R_PAREN@[20; 21) | ||
14 | WHITESPACE@[21; 22) | ||
15 | BLOCK@[22; 24) | ||
16 | L_CURLY@[22; 23) | ||
17 | R_CURLY@[23; 24) | ||
18 | WHITESPACE@[24; 25) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0099_param_list.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0099_param_list.rs new file mode 100644 index 000000000..9d55bedbb --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0099_param_list.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn a() {} | ||
2 | fn b(x: i32) {} | ||
3 | fn c(x: i32, ) {} | ||
4 | fn d(x: i32, y: ()) {} | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0099_param_list.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0099_param_list.txt new file mode 100644 index 000000000..503fc97ff --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0099_param_list.txt | |||
@@ -0,0 +1,99 @@ | |||
1 | SOURCE_FILE@[0; 67) | ||
2 | FN_DEF@[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@[7; 9) | ||
12 | L_CURLY@[7; 8) | ||
13 | R_CURLY@[8; 9) | ||
14 | WHITESPACE@[9; 10) | ||
15 | FN_DEF@[10; 25) | ||
16 | FN_KW@[10; 12) | ||
17 | WHITESPACE@[12; 13) | ||
18 | NAME@[13; 14) | ||
19 | IDENT@[13; 14) "b" | ||
20 | PARAM_LIST@[14; 22) | ||
21 | L_PAREN@[14; 15) | ||
22 | PARAM@[15; 21) | ||
23 | BIND_PAT@[15; 16) | ||
24 | NAME@[15; 16) | ||
25 | IDENT@[15; 16) "x" | ||
26 | COLON@[16; 17) | ||
27 | WHITESPACE@[17; 18) | ||
28 | PATH_TYPE@[18; 21) | ||
29 | PATH@[18; 21) | ||
30 | PATH_SEGMENT@[18; 21) | ||
31 | NAME_REF@[18; 21) | ||
32 | IDENT@[18; 21) "i32" | ||
33 | R_PAREN@[21; 22) | ||
34 | WHITESPACE@[22; 23) | ||
35 | BLOCK@[23; 25) | ||
36 | L_CURLY@[23; 24) | ||
37 | R_CURLY@[24; 25) | ||
38 | WHITESPACE@[25; 26) | ||
39 | FN_DEF@[26; 43) | ||
40 | FN_KW@[26; 28) | ||
41 | WHITESPACE@[28; 29) | ||
42 | NAME@[29; 30) | ||
43 | IDENT@[29; 30) "c" | ||
44 | PARAM_LIST@[30; 40) | ||
45 | L_PAREN@[30; 31) | ||
46 | PARAM@[31; 37) | ||
47 | BIND_PAT@[31; 32) | ||
48 | NAME@[31; 32) | ||
49 | IDENT@[31; 32) "x" | ||
50 | COLON@[32; 33) | ||
51 | WHITESPACE@[33; 34) | ||
52 | PATH_TYPE@[34; 37) | ||
53 | PATH@[34; 37) | ||
54 | PATH_SEGMENT@[34; 37) | ||
55 | NAME_REF@[34; 37) | ||
56 | IDENT@[34; 37) "i32" | ||
57 | COMMA@[37; 38) | ||
58 | WHITESPACE@[38; 39) | ||
59 | R_PAREN@[39; 40) | ||
60 | WHITESPACE@[40; 41) | ||
61 | BLOCK@[41; 43) | ||
62 | L_CURLY@[41; 42) | ||
63 | R_CURLY@[42; 43) | ||
64 | WHITESPACE@[43; 44) | ||
65 | FN_DEF@[44; 66) | ||
66 | FN_KW@[44; 46) | ||
67 | WHITESPACE@[46; 47) | ||
68 | NAME@[47; 48) | ||
69 | IDENT@[47; 48) "d" | ||
70 | PARAM_LIST@[48; 63) | ||
71 | L_PAREN@[48; 49) | ||
72 | PARAM@[49; 55) | ||
73 | BIND_PAT@[49; 50) | ||
74 | NAME@[49; 50) | ||
75 | IDENT@[49; 50) "x" | ||
76 | COLON@[50; 51) | ||
77 | WHITESPACE@[51; 52) | ||
78 | PATH_TYPE@[52; 55) | ||
79 | PATH@[52; 55) | ||
80 | PATH_SEGMENT@[52; 55) | ||
81 | NAME_REF@[52; 55) | ||
82 | IDENT@[52; 55) "i32" | ||
83 | COMMA@[55; 56) | ||
84 | WHITESPACE@[56; 57) | ||
85 | PARAM@[57; 62) | ||
86 | BIND_PAT@[57; 58) | ||
87 | NAME@[57; 58) | ||
88 | IDENT@[57; 58) "y" | ||
89 | COLON@[58; 59) | ||
90 | WHITESPACE@[59; 60) | ||
91 | TUPLE_TYPE@[60; 62) | ||
92 | L_PAREN@[60; 61) | ||
93 | R_PAREN@[61; 62) | ||
94 | R_PAREN@[62; 63) | ||
95 | WHITESPACE@[63; 64) | ||
96 | BLOCK@[64; 66) | ||
97 | L_CURLY@[64; 65) | ||
98 | R_CURLY@[65; 66) | ||
99 | WHITESPACE@[66; 67) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0100_for_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0100_for_expr.rs new file mode 100644 index 000000000..972197d2a --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0100_for_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | for x in [] {}; | ||
3 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0100_for_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0100_for_expr.txt new file mode 100644 index 000000000..998f12110 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0100_for_expr.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | SOURCE_FILE@[0; 33) | ||
2 | FN_DEF@[0; 32) | ||
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@[9; 32) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 30) | ||
15 | FOR_EXPR@[15; 29) | ||
16 | FOR_KW@[15; 18) | ||
17 | WHITESPACE@[18; 19) | ||
18 | BIND_PAT@[19; 20) | ||
19 | NAME@[19; 20) | ||
20 | IDENT@[19; 20) "x" | ||
21 | WHITESPACE@[20; 21) | ||
22 | IN_KW@[21; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | ARRAY_EXPR@[24; 26) | ||
25 | L_BRACK@[24; 25) | ||
26 | R_BRACK@[25; 26) | ||
27 | WHITESPACE@[26; 27) | ||
28 | BLOCK@[27; 29) | ||
29 | L_CURLY@[27; 28) | ||
30 | R_CURLY@[28; 29) | ||
31 | SEMI@[29; 30) | ||
32 | WHITESPACE@[30; 31) | ||
33 | R_CURLY@[31; 32) | ||
34 | WHITESPACE@[32; 33) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0101_unsafe_fn.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0101_unsafe_fn.rs new file mode 100644 index 000000000..33cfc4cd7 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0101_unsafe_fn.rs | |||
@@ -0,0 +1 @@ | |||
unsafe fn foo() {} | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0101_unsafe_fn.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0101_unsafe_fn.txt new file mode 100644 index 000000000..5498dbcbb --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0101_unsafe_fn.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 19) | ||
2 | FN_DEF@[0; 18) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | FN_KW@[7; 9) | ||
6 | WHITESPACE@[9; 10) | ||
7 | NAME@[10; 13) | ||
8 | IDENT@[10; 13) "foo" | ||
9 | PARAM_LIST@[13; 15) | ||
10 | L_PAREN@[13; 14) | ||
11 | R_PAREN@[14; 15) | ||
12 | WHITESPACE@[15; 16) | ||
13 | BLOCK@[16; 18) | ||
14 | L_CURLY@[16; 17) | ||
15 | R_CURLY@[17; 18) | ||
16 | WHITESPACE@[18; 19) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0102_field_pat_list.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0102_field_pat_list.rs new file mode 100644 index 000000000..da3412fa8 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0102_field_pat_list.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let S {} = (); | ||
3 | let S { f, ref mut g } = (); | ||
4 | let S { h: _, ..} = (); | ||
5 | let S { h: _, } = (); | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0102_field_pat_list.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0102_field_pat_list.txt new file mode 100644 index 000000000..13a51a9d9 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0102_field_pat_list.txt | |||
@@ -0,0 +1,126 @@ | |||
1 | SOURCE_FILE@[0; 119) | ||
2 | FN_DEF@[0; 118) | ||
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@[9; 118) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 29) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | STRUCT_PAT@[19; 23) | ||
18 | PATH@[19; 20) | ||
19 | PATH_SEGMENT@[19; 20) | ||
20 | NAME_REF@[19; 20) | ||
21 | IDENT@[19; 20) "S" | ||
22 | WHITESPACE@[20; 21) | ||
23 | FIELD_PAT_LIST@[21; 23) | ||
24 | L_CURLY@[21; 22) | ||
25 | R_CURLY@[22; 23) | ||
26 | WHITESPACE@[23; 24) | ||
27 | EQ@[24; 25) | ||
28 | WHITESPACE@[25; 26) | ||
29 | TUPLE_EXPR@[26; 28) | ||
30 | L_PAREN@[26; 27) | ||
31 | R_PAREN@[27; 28) | ||
32 | SEMI@[28; 29) | ||
33 | WHITESPACE@[29; 34) | ||
34 | LET_STMT@[34; 62) | ||
35 | LET_KW@[34; 37) | ||
36 | WHITESPACE@[37; 38) | ||
37 | STRUCT_PAT@[38; 56) | ||
38 | PATH@[38; 39) | ||
39 | PATH_SEGMENT@[38; 39) | ||
40 | NAME_REF@[38; 39) | ||
41 | IDENT@[38; 39) "S" | ||
42 | WHITESPACE@[39; 40) | ||
43 | FIELD_PAT_LIST@[40; 56) | ||
44 | L_CURLY@[40; 41) | ||
45 | WHITESPACE@[41; 42) | ||
46 | BIND_PAT@[42; 43) | ||
47 | NAME@[42; 43) | ||
48 | IDENT@[42; 43) "f" | ||
49 | COMMA@[43; 44) | ||
50 | WHITESPACE@[44; 45) | ||
51 | BIND_PAT@[45; 54) | ||
52 | REF_KW@[45; 48) | ||
53 | WHITESPACE@[48; 49) | ||
54 | MUT_KW@[49; 52) | ||
55 | WHITESPACE@[52; 53) | ||
56 | NAME@[53; 54) | ||
57 | IDENT@[53; 54) "g" | ||
58 | WHITESPACE@[54; 55) | ||
59 | R_CURLY@[55; 56) | ||
60 | WHITESPACE@[56; 57) | ||
61 | EQ@[57; 58) | ||
62 | WHITESPACE@[58; 59) | ||
63 | TUPLE_EXPR@[59; 61) | ||
64 | L_PAREN@[59; 60) | ||
65 | R_PAREN@[60; 61) | ||
66 | SEMI@[61; 62) | ||
67 | WHITESPACE@[62; 67) | ||
68 | LET_STMT@[67; 90) | ||
69 | LET_KW@[67; 70) | ||
70 | WHITESPACE@[70; 71) | ||
71 | STRUCT_PAT@[71; 84) | ||
72 | PATH@[71; 72) | ||
73 | PATH_SEGMENT@[71; 72) | ||
74 | NAME_REF@[71; 72) | ||
75 | IDENT@[71; 72) "S" | ||
76 | WHITESPACE@[72; 73) | ||
77 | FIELD_PAT_LIST@[73; 84) | ||
78 | L_CURLY@[73; 74) | ||
79 | WHITESPACE@[74; 75) | ||
80 | IDENT@[75; 76) "h" | ||
81 | COLON@[76; 77) | ||
82 | WHITESPACE@[77; 78) | ||
83 | PLACEHOLDER_PAT@[78; 79) | ||
84 | UNDERSCORE@[78; 79) | ||
85 | COMMA@[79; 80) | ||
86 | WHITESPACE@[80; 81) | ||
87 | DOTDOT@[81; 83) | ||
88 | R_CURLY@[83; 84) | ||
89 | WHITESPACE@[84; 85) | ||
90 | EQ@[85; 86) | ||
91 | WHITESPACE@[86; 87) | ||
92 | TUPLE_EXPR@[87; 89) | ||
93 | L_PAREN@[87; 88) | ||
94 | R_PAREN@[88; 89) | ||
95 | SEMI@[89; 90) | ||
96 | WHITESPACE@[90; 95) | ||
97 | LET_STMT@[95; 116) | ||
98 | LET_KW@[95; 98) | ||
99 | WHITESPACE@[98; 99) | ||
100 | STRUCT_PAT@[99; 110) | ||
101 | PATH@[99; 100) | ||
102 | PATH_SEGMENT@[99; 100) | ||
103 | NAME_REF@[99; 100) | ||
104 | IDENT@[99; 100) "S" | ||
105 | WHITESPACE@[100; 101) | ||
106 | FIELD_PAT_LIST@[101; 110) | ||
107 | L_CURLY@[101; 102) | ||
108 | WHITESPACE@[102; 103) | ||
109 | IDENT@[103; 104) "h" | ||
110 | COLON@[104; 105) | ||
111 | WHITESPACE@[105; 106) | ||
112 | PLACEHOLDER_PAT@[106; 107) | ||
113 | UNDERSCORE@[106; 107) | ||
114 | COMMA@[107; 108) | ||
115 | WHITESPACE@[108; 109) | ||
116 | R_CURLY@[109; 110) | ||
117 | WHITESPACE@[110; 111) | ||
118 | EQ@[111; 112) | ||
119 | WHITESPACE@[112; 113) | ||
120 | TUPLE_EXPR@[113; 115) | ||
121 | L_PAREN@[113; 114) | ||
122 | R_PAREN@[114; 115) | ||
123 | SEMI@[115; 116) | ||
124 | WHITESPACE@[116; 117) | ||
125 | R_CURLY@[117; 118) | ||
126 | WHITESPACE@[118; 119) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0103_array_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0103_array_expr.rs new file mode 100644 index 000000000..4dc1999d1 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0103_array_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | []; | ||
3 | [1]; | ||
4 | [1, 2,]; | ||
5 | [1; 2]; | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0103_array_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0103_array_expr.txt new file mode 100644 index 000000000..42df7c450 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0103_array_expr.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | SOURCE_FILE@[0; 55) | ||
2 | FN_DEF@[0; 54) | ||
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@[9; 54) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 18) | ||
15 | ARRAY_EXPR@[15; 17) | ||
16 | L_BRACK@[15; 16) | ||
17 | R_BRACK@[16; 17) | ||
18 | SEMI@[17; 18) | ||
19 | WHITESPACE@[18; 23) | ||
20 | EXPR_STMT@[23; 27) | ||
21 | ARRAY_EXPR@[23; 26) | ||
22 | L_BRACK@[23; 24) | ||
23 | LITERAL@[24; 25) | ||
24 | INT_NUMBER@[24; 25) "1" | ||
25 | R_BRACK@[25; 26) | ||
26 | SEMI@[26; 27) | ||
27 | WHITESPACE@[27; 32) | ||
28 | EXPR_STMT@[32; 40) | ||
29 | ARRAY_EXPR@[32; 39) | ||
30 | L_BRACK@[32; 33) | ||
31 | LITERAL@[33; 34) | ||
32 | INT_NUMBER@[33; 34) "1" | ||
33 | COMMA@[34; 35) | ||
34 | WHITESPACE@[35; 36) | ||
35 | LITERAL@[36; 37) | ||
36 | INT_NUMBER@[36; 37) "2" | ||
37 | COMMA@[37; 38) | ||
38 | R_BRACK@[38; 39) | ||
39 | SEMI@[39; 40) | ||
40 | WHITESPACE@[40; 45) | ||
41 | EXPR_STMT@[45; 52) | ||
42 | ARRAY_EXPR@[45; 51) | ||
43 | L_BRACK@[45; 46) | ||
44 | LITERAL@[46; 47) | ||
45 | INT_NUMBER@[46; 47) "1" | ||
46 | SEMI@[47; 48) | ||
47 | WHITESPACE@[48; 49) | ||
48 | LITERAL@[49; 50) | ||
49 | INT_NUMBER@[49; 50) "2" | ||
50 | R_BRACK@[50; 51) | ||
51 | SEMI@[51; 52) | ||
52 | WHITESPACE@[52; 53) | ||
53 | R_CURLY@[53; 54) | ||
54 | WHITESPACE@[54; 55) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.rs new file mode 100644 index 000000000..aef45e561 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.rs | |||
@@ -0,0 +1 @@ | |||
type F = Box<Fn(x: i32) -> ()>; | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.txt new file mode 100644 index 000000000..ba1163c2d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.txt | |||
@@ -0,0 +1,46 @@ | |||
1 | SOURCE_FILE@[0; 32) | ||
2 | TYPE_DEF@[0; 31) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PATH_TYPE@[9; 30) | ||
11 | PATH@[9; 30) | ||
12 | PATH_SEGMENT@[9; 30) | ||
13 | NAME_REF@[9; 12) | ||
14 | IDENT@[9; 12) "Box" | ||
15 | TYPE_ARG_LIST@[12; 30) | ||
16 | L_ANGLE@[12; 13) | ||
17 | TYPE_ARG@[13; 29) | ||
18 | PATH_TYPE@[13; 29) | ||
19 | PATH@[13; 29) | ||
20 | PATH_SEGMENT@[13; 29) | ||
21 | NAME_REF@[13; 15) | ||
22 | IDENT@[13; 15) "Fn" | ||
23 | PARAM_LIST@[15; 23) | ||
24 | L_PAREN@[15; 16) | ||
25 | PARAM@[16; 22) | ||
26 | BIND_PAT@[16; 17) | ||
27 | NAME@[16; 17) | ||
28 | IDENT@[16; 17) "x" | ||
29 | COLON@[17; 18) | ||
30 | WHITESPACE@[18; 19) | ||
31 | PATH_TYPE@[19; 22) | ||
32 | PATH@[19; 22) | ||
33 | PATH_SEGMENT@[19; 22) | ||
34 | NAME_REF@[19; 22) | ||
35 | IDENT@[19; 22) "i32" | ||
36 | R_PAREN@[22; 23) | ||
37 | WHITESPACE@[23; 24) | ||
38 | RET_TYPE@[24; 29) | ||
39 | THIN_ARROW@[24; 26) | ||
40 | WHITESPACE@[26; 27) | ||
41 | TUPLE_TYPE@[27; 29) | ||
42 | L_PAREN@[27; 28) | ||
43 | R_PAREN@[28; 29) | ||
44 | R_ANGLE@[29; 30) | ||
45 | SEMI@[30; 31) | ||
46 | WHITESPACE@[31; 32) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0105_block_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0105_block_expr.rs new file mode 100644 index 000000000..2fed74c5e --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0105_block_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | {}; | ||
3 | unsafe {}; | ||
4 | 'label: {}; | ||
5 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0105_block_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0105_block_expr.txt new file mode 100644 index 000000000..eeb184ab2 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0105_block_expr.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | SOURCE_FILE@[0; 52) | ||
2 | FN_DEF@[0; 51) | ||
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@[9; 51) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 18) | ||
15 | BLOCK_EXPR@[15; 17) | ||
16 | BLOCK@[15; 17) | ||
17 | L_CURLY@[15; 16) | ||
18 | R_CURLY@[16; 17) | ||
19 | SEMI@[17; 18) | ||
20 | WHITESPACE@[18; 23) | ||
21 | EXPR_STMT@[23; 33) | ||
22 | BLOCK_EXPR@[23; 32) | ||
23 | UNSAFE_KW@[23; 29) | ||
24 | WHITESPACE@[29; 30) | ||
25 | BLOCK@[30; 32) | ||
26 | L_CURLY@[30; 31) | ||
27 | R_CURLY@[31; 32) | ||
28 | SEMI@[32; 33) | ||
29 | WHITESPACE@[33; 38) | ||
30 | EXPR_STMT@[38; 49) | ||
31 | BLOCK_EXPR@[38; 48) | ||
32 | LABEL@[38; 45) | ||
33 | LIFETIME@[38; 44) "'label" | ||
34 | COLON@[44; 45) | ||
35 | WHITESPACE@[45; 46) | ||
36 | BLOCK@[46; 48) | ||
37 | L_CURLY@[46; 47) | ||
38 | R_CURLY@[47; 48) | ||
39 | SEMI@[48; 49) | ||
40 | WHITESPACE@[49; 50) | ||
41 | R_CURLY@[50; 51) | ||
42 | WHITESPACE@[51; 52) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0106_lambda_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0106_lambda_expr.rs new file mode 100644 index 000000000..c20d29751 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0106_lambda_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | || (); | ||
3 | || -> i32 { 92 }; | ||
4 | |x| x; | ||
5 | move |x: i32,| x; | ||
6 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0106_lambda_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0106_lambda_expr.txt new file mode 100644 index 000000000..98271c233 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0106_lambda_expr.txt | |||
@@ -0,0 +1,95 @@ | |||
1 | SOURCE_FILE@[0; 79) | ||
2 | FN_DEF@[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@[9; 78) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 21) | ||
15 | LAMBDA_EXPR@[15; 20) | ||
16 | PARAM_LIST@[15; 17) | ||
17 | PIPE@[15; 16) | ||
18 | PIPE@[16; 17) | ||
19 | WHITESPACE@[17; 18) | ||
20 | TUPLE_EXPR@[18; 20) | ||
21 | L_PAREN@[18; 19) | ||
22 | R_PAREN@[19; 20) | ||
23 | SEMI@[20; 21) | ||
24 | WHITESPACE@[21; 26) | ||
25 | EXPR_STMT@[26; 43) | ||
26 | LAMBDA_EXPR@[26; 42) | ||
27 | PARAM_LIST@[26; 28) | ||
28 | PIPE@[26; 27) | ||
29 | PIPE@[27; 28) | ||
30 | WHITESPACE@[28; 29) | ||
31 | RET_TYPE@[29; 35) | ||
32 | THIN_ARROW@[29; 31) | ||
33 | WHITESPACE@[31; 32) | ||
34 | PATH_TYPE@[32; 35) | ||
35 | PATH@[32; 35) | ||
36 | PATH_SEGMENT@[32; 35) | ||
37 | NAME_REF@[32; 35) | ||
38 | IDENT@[32; 35) "i32" | ||
39 | WHITESPACE@[35; 36) | ||
40 | BLOCK_EXPR@[36; 42) | ||
41 | BLOCK@[36; 42) | ||
42 | L_CURLY@[36; 37) | ||
43 | WHITESPACE@[37; 38) | ||
44 | LITERAL@[38; 40) | ||
45 | INT_NUMBER@[38; 40) "92" | ||
46 | WHITESPACE@[40; 41) | ||
47 | R_CURLY@[41; 42) | ||
48 | SEMI@[42; 43) | ||
49 | WHITESPACE@[43; 48) | ||
50 | EXPR_STMT@[48; 54) | ||
51 | LAMBDA_EXPR@[48; 53) | ||
52 | PARAM_LIST@[48; 51) | ||
53 | PIPE@[48; 49) | ||
54 | PARAM@[49; 50) | ||
55 | BIND_PAT@[49; 50) | ||
56 | NAME@[49; 50) | ||
57 | IDENT@[49; 50) "x" | ||
58 | PIPE@[50; 51) | ||
59 | WHITESPACE@[51; 52) | ||
60 | PATH_EXPR@[52; 53) | ||
61 | PATH@[52; 53) | ||
62 | PATH_SEGMENT@[52; 53) | ||
63 | NAME_REF@[52; 53) | ||
64 | IDENT@[52; 53) "x" | ||
65 | SEMI@[53; 54) | ||
66 | WHITESPACE@[54; 59) | ||
67 | EXPR_STMT@[59; 76) | ||
68 | LAMBDA_EXPR@[59; 75) | ||
69 | MOVE_KW@[59; 63) | ||
70 | WHITESPACE@[63; 64) | ||
71 | PARAM_LIST@[64; 73) | ||
72 | PIPE@[64; 65) | ||
73 | PARAM@[65; 71) | ||
74 | BIND_PAT@[65; 66) | ||
75 | NAME@[65; 66) | ||
76 | IDENT@[65; 66) "x" | ||
77 | COLON@[66; 67) | ||
78 | WHITESPACE@[67; 68) | ||
79 | PATH_TYPE@[68; 71) | ||
80 | PATH@[68; 71) | ||
81 | PATH_SEGMENT@[68; 71) | ||
82 | NAME_REF@[68; 71) | ||
83 | IDENT@[68; 71) "i32" | ||
84 | COMMA@[71; 72) | ||
85 | PIPE@[72; 73) | ||
86 | WHITESPACE@[73; 74) | ||
87 | PATH_EXPR@[74; 75) | ||
88 | PATH@[74; 75) | ||
89 | PATH_SEGMENT@[74; 75) | ||
90 | NAME_REF@[74; 75) | ||
91 | IDENT@[74; 75) "x" | ||
92 | SEMI@[75; 76) | ||
93 | WHITESPACE@[76; 77) | ||
94 | R_CURLY@[77; 78) | ||
95 | WHITESPACE@[78; 79) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0107_method_call_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0107_method_call_expr.rs new file mode 100644 index 000000000..1a3aa35ae --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0107_method_call_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | x.foo(); | ||
3 | y.bar::<T>(1, 2,); | ||
4 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0107_method_call_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0107_method_call_expr.txt new file mode 100644 index 000000000..51ecfdf78 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0107_method_call_expr.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | SOURCE_FILE@[0; 49) | ||
2 | FN_DEF@[0; 48) | ||
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@[9; 48) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 23) | ||
15 | METHOD_CALL_EXPR@[15; 22) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | DOT@[16; 17) | ||
22 | NAME_REF@[17; 20) | ||
23 | IDENT@[17; 20) "foo" | ||
24 | ARG_LIST@[20; 22) | ||
25 | L_PAREN@[20; 21) | ||
26 | R_PAREN@[21; 22) | ||
27 | SEMI@[22; 23) | ||
28 | WHITESPACE@[23; 28) | ||
29 | EXPR_STMT@[28; 46) | ||
30 | METHOD_CALL_EXPR@[28; 45) | ||
31 | PATH_EXPR@[28; 29) | ||
32 | PATH@[28; 29) | ||
33 | PATH_SEGMENT@[28; 29) | ||
34 | NAME_REF@[28; 29) | ||
35 | IDENT@[28; 29) "y" | ||
36 | DOT@[29; 30) | ||
37 | NAME_REF@[30; 33) | ||
38 | IDENT@[30; 33) "bar" | ||
39 | TYPE_ARG_LIST@[33; 38) | ||
40 | COLONCOLON@[33; 35) | ||
41 | L_ANGLE@[35; 36) | ||
42 | TYPE_ARG@[36; 37) | ||
43 | PATH_TYPE@[36; 37) | ||
44 | PATH@[36; 37) | ||
45 | PATH_SEGMENT@[36; 37) | ||
46 | NAME_REF@[36; 37) | ||
47 | IDENT@[36; 37) "T" | ||
48 | R_ANGLE@[37; 38) | ||
49 | ARG_LIST@[38; 45) | ||
50 | L_PAREN@[38; 39) | ||
51 | LITERAL@[39; 40) | ||
52 | INT_NUMBER@[39; 40) "1" | ||
53 | COMMA@[40; 41) | ||
54 | WHITESPACE@[41; 42) | ||
55 | LITERAL@[42; 43) | ||
56 | INT_NUMBER@[42; 43) "2" | ||
57 | COMMA@[43; 44) | ||
58 | R_PAREN@[44; 45) | ||
59 | SEMI@[45; 46) | ||
60 | WHITESPACE@[46; 47) | ||
61 | R_CURLY@[47; 48) | ||
62 | WHITESPACE@[48; 49) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0108_tuple_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0108_tuple_expr.rs new file mode 100644 index 000000000..e4f774280 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0108_tuple_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | (); | ||
3 | (1); | ||
4 | (1,); | ||
5 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0108_tuple_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0108_tuple_expr.txt new file mode 100644 index 000000000..4e427c909 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0108_tuple_expr.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | SOURCE_FILE@[0; 40) | ||
2 | FN_DEF@[0; 39) | ||
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@[9; 39) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 18) | ||
15 | TUPLE_EXPR@[15; 17) | ||
16 | L_PAREN@[15; 16) | ||
17 | R_PAREN@[16; 17) | ||
18 | SEMI@[17; 18) | ||
19 | WHITESPACE@[18; 23) | ||
20 | EXPR_STMT@[23; 27) | ||
21 | PAREN_EXPR@[23; 26) | ||
22 | L_PAREN@[23; 24) | ||
23 | LITERAL@[24; 25) | ||
24 | INT_NUMBER@[24; 25) "1" | ||
25 | R_PAREN@[25; 26) | ||
26 | SEMI@[26; 27) | ||
27 | WHITESPACE@[27; 32) | ||
28 | EXPR_STMT@[32; 37) | ||
29 | TUPLE_EXPR@[32; 36) | ||
30 | L_PAREN@[32; 33) | ||
31 | LITERAL@[33; 34) | ||
32 | INT_NUMBER@[33; 34) "1" | ||
33 | COMMA@[34; 35) | ||
34 | R_PAREN@[35; 36) | ||
35 | SEMI@[36; 37) | ||
36 | WHITESPACE@[37; 38) | ||
37 | R_CURLY@[38; 39) | ||
38 | WHITESPACE@[39; 40) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0109_label.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0109_label.rs new file mode 100644 index 000000000..48e83f263 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0109_label.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | 'a: loop {} | ||
3 | 'b: while true {} | ||
4 | 'c: for x in () {} | ||
5 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0109_label.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0109_label.txt new file mode 100644 index 000000000..c641c3b16 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0109_label.txt | |||
@@ -0,0 +1,64 @@ | |||
1 | SOURCE_FILE@[0; 74) | ||
2 | FN_DEF@[0; 73) | ||
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@[9; 73) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 26) | ||
15 | LOOP_EXPR@[15; 26) | ||
16 | LABEL@[15; 18) | ||
17 | LIFETIME@[15; 17) "'a" | ||
18 | COLON@[17; 18) | ||
19 | WHITESPACE@[18; 19) | ||
20 | LOOP_KW@[19; 23) | ||
21 | WHITESPACE@[23; 24) | ||
22 | BLOCK@[24; 26) | ||
23 | L_CURLY@[24; 25) | ||
24 | R_CURLY@[25; 26) | ||
25 | WHITESPACE@[26; 31) | ||
26 | EXPR_STMT@[31; 48) | ||
27 | WHILE_EXPR@[31; 48) | ||
28 | LABEL@[31; 34) | ||
29 | LIFETIME@[31; 33) "'b" | ||
30 | COLON@[33; 34) | ||
31 | WHITESPACE@[34; 35) | ||
32 | WHILE_KW@[35; 40) | ||
33 | WHITESPACE@[40; 41) | ||
34 | CONDITION@[41; 45) | ||
35 | LITERAL@[41; 45) | ||
36 | TRUE_KW@[41; 45) | ||
37 | WHITESPACE@[45; 46) | ||
38 | BLOCK@[46; 48) | ||
39 | L_CURLY@[46; 47) | ||
40 | R_CURLY@[47; 48) | ||
41 | WHITESPACE@[48; 53) | ||
42 | FOR_EXPR@[53; 71) | ||
43 | LABEL@[53; 56) | ||
44 | LIFETIME@[53; 55) "'c" | ||
45 | COLON@[55; 56) | ||
46 | WHITESPACE@[56; 57) | ||
47 | FOR_KW@[57; 60) | ||
48 | WHITESPACE@[60; 61) | ||
49 | BIND_PAT@[61; 62) | ||
50 | NAME@[61; 62) | ||
51 | IDENT@[61; 62) "x" | ||
52 | WHITESPACE@[62; 63) | ||
53 | IN_KW@[63; 65) | ||
54 | WHITESPACE@[65; 66) | ||
55 | TUPLE_EXPR@[66; 68) | ||
56 | L_PAREN@[66; 67) | ||
57 | R_PAREN@[67; 68) | ||
58 | WHITESPACE@[68; 69) | ||
59 | BLOCK@[69; 71) | ||
60 | L_CURLY@[69; 70) | ||
61 | R_CURLY@[70; 71) | ||
62 | WHITESPACE@[71; 72) | ||
63 | R_CURLY@[72; 73) | ||
64 | WHITESPACE@[73; 74) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0110_use_path.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0110_use_path.rs new file mode 100644 index 000000000..328e94736 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0110_use_path.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | use ::crate_name; // Rust 2018 - All flavours | ||
2 | use crate_name; // Rust 2018 - Anchored paths | ||
3 | use item_in_scope_or_crate_name; // Rust 2018 - Uniform Paths | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0110_use_path.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0110_use_path.txt new file mode 100644 index 000000000..420449e61 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0110_use_path.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | SOURCE_FILE@[0; 154) | ||
2 | USE_ITEM@[0; 17) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 16) | ||
6 | PATH@[4; 16) | ||
7 | PATH_SEGMENT@[4; 16) | ||
8 | COLONCOLON@[4; 6) | ||
9 | NAME_REF@[6; 16) | ||
10 | IDENT@[6; 16) "crate_name" | ||
11 | SEMI@[16; 17) | ||
12 | WHITESPACE@[17; 18) | ||
13 | COMMENT@[18; 45) | ||
14 | WHITESPACE@[45; 46) | ||
15 | USE_ITEM@[46; 61) | ||
16 | USE_KW@[46; 49) | ||
17 | WHITESPACE@[49; 50) | ||
18 | USE_TREE@[50; 60) | ||
19 | PATH@[50; 60) | ||
20 | PATH_SEGMENT@[50; 60) | ||
21 | NAME_REF@[50; 60) | ||
22 | IDENT@[50; 60) "crate_name" | ||
23 | SEMI@[60; 61) | ||
24 | WHITESPACE@[61; 62) | ||
25 | COMMENT@[62; 91) | ||
26 | WHITESPACE@[91; 92) | ||
27 | USE_ITEM@[92; 124) | ||
28 | USE_KW@[92; 95) | ||
29 | WHITESPACE@[95; 96) | ||
30 | USE_TREE@[96; 123) | ||
31 | PATH@[96; 123) | ||
32 | PATH_SEGMENT@[96; 123) | ||
33 | NAME_REF@[96; 123) | ||
34 | IDENT@[96; 123) "item_in_scope_or_crate_name" | ||
35 | SEMI@[123; 124) | ||
36 | WHITESPACE@[124; 125) | ||
37 | COMMENT@[125; 153) | ||
38 | WHITESPACE@[153; 154) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0111_tuple_pat.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0111_tuple_pat.rs new file mode 100644 index 000000000..f785acd36 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0111_tuple_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | let (a, b, ..) = (); | ||
3 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0111_tuple_pat.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0111_tuple_pat.txt new file mode 100644 index 000000000..2471f6f8c --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0111_tuple_pat.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | SOURCE_FILE@[0; 39) | ||
2 | FN_DEF@[0; 38) | ||
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@[10; 38) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 36) | ||
15 | LET_KW@[16; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | TUPLE_PAT@[20; 30) | ||
18 | L_PAREN@[20; 21) | ||
19 | BIND_PAT@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "a" | ||
22 | COMMA@[22; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | BIND_PAT@[24; 25) | ||
25 | NAME@[24; 25) | ||
26 | IDENT@[24; 25) "b" | ||
27 | COMMA@[25; 26) | ||
28 | WHITESPACE@[26; 27) | ||
29 | DOTDOT@[27; 29) | ||
30 | R_PAREN@[29; 30) | ||
31 | WHITESPACE@[30; 31) | ||
32 | EQ@[31; 32) | ||
33 | WHITESPACE@[32; 33) | ||
34 | TUPLE_EXPR@[33; 35) | ||
35 | L_PAREN@[33; 34) | ||
36 | R_PAREN@[34; 35) | ||
37 | SEMI@[35; 36) | ||
38 | WHITESPACE@[36; 37) | ||
39 | R_CURLY@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0112_bind_pat.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0112_bind_pat.rs new file mode 100644 index 000000000..820a9e72c --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0112_bind_pat.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | fn main() { | ||
2 | let a = (); | ||
3 | let mut b = (); | ||
4 | let ref c = (); | ||
5 | let ref mut d = (); | ||
6 | let e @ _ = (); | ||
7 | let ref mut f @ g @ _ = (); | ||
8 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0112_bind_pat.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0112_bind_pat.txt new file mode 100644 index 000000000..86f8154ea --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0112_bind_pat.txt | |||
@@ -0,0 +1,127 @@ | |||
1 | SOURCE_FILE@[0; 146) | ||
2 | FN_DEF@[0; 145) | ||
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@[10; 145) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 27) | ||
15 | LET_KW@[16; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | BIND_PAT@[20; 21) | ||
18 | NAME@[20; 21) | ||
19 | IDENT@[20; 21) "a" | ||
20 | WHITESPACE@[21; 22) | ||
21 | EQ@[22; 23) | ||
22 | WHITESPACE@[23; 24) | ||
23 | TUPLE_EXPR@[24; 26) | ||
24 | L_PAREN@[24; 25) | ||
25 | R_PAREN@[25; 26) | ||
26 | SEMI@[26; 27) | ||
27 | WHITESPACE@[27; 32) | ||
28 | LET_STMT@[32; 47) | ||
29 | LET_KW@[32; 35) | ||
30 | WHITESPACE@[35; 36) | ||
31 | BIND_PAT@[36; 41) | ||
32 | MUT_KW@[36; 39) | ||
33 | WHITESPACE@[39; 40) | ||
34 | NAME@[40; 41) | ||
35 | IDENT@[40; 41) "b" | ||
36 | WHITESPACE@[41; 42) | ||
37 | EQ@[42; 43) | ||
38 | WHITESPACE@[43; 44) | ||
39 | TUPLE_EXPR@[44; 46) | ||
40 | L_PAREN@[44; 45) | ||
41 | R_PAREN@[45; 46) | ||
42 | SEMI@[46; 47) | ||
43 | WHITESPACE@[47; 52) | ||
44 | LET_STMT@[52; 67) | ||
45 | LET_KW@[52; 55) | ||
46 | WHITESPACE@[55; 56) | ||
47 | BIND_PAT@[56; 61) | ||
48 | REF_KW@[56; 59) | ||
49 | WHITESPACE@[59; 60) | ||
50 | NAME@[60; 61) | ||
51 | IDENT@[60; 61) "c" | ||
52 | WHITESPACE@[61; 62) | ||
53 | EQ@[62; 63) | ||
54 | WHITESPACE@[63; 64) | ||
55 | TUPLE_EXPR@[64; 66) | ||
56 | L_PAREN@[64; 65) | ||
57 | R_PAREN@[65; 66) | ||
58 | SEMI@[66; 67) | ||
59 | WHITESPACE@[67; 72) | ||
60 | LET_STMT@[72; 91) | ||
61 | LET_KW@[72; 75) | ||
62 | WHITESPACE@[75; 76) | ||
63 | BIND_PAT@[76; 85) | ||
64 | REF_KW@[76; 79) | ||
65 | WHITESPACE@[79; 80) | ||
66 | MUT_KW@[80; 83) | ||
67 | WHITESPACE@[83; 84) | ||
68 | NAME@[84; 85) | ||
69 | IDENT@[84; 85) "d" | ||
70 | WHITESPACE@[85; 86) | ||
71 | EQ@[86; 87) | ||
72 | WHITESPACE@[87; 88) | ||
73 | TUPLE_EXPR@[88; 90) | ||
74 | L_PAREN@[88; 89) | ||
75 | R_PAREN@[89; 90) | ||
76 | SEMI@[90; 91) | ||
77 | WHITESPACE@[91; 96) | ||
78 | LET_STMT@[96; 111) | ||
79 | LET_KW@[96; 99) | ||
80 | WHITESPACE@[99; 100) | ||
81 | BIND_PAT@[100; 105) | ||
82 | NAME@[100; 101) | ||
83 | IDENT@[100; 101) "e" | ||
84 | WHITESPACE@[101; 102) | ||
85 | AT@[102; 103) | ||
86 | WHITESPACE@[103; 104) | ||
87 | PLACEHOLDER_PAT@[104; 105) | ||
88 | UNDERSCORE@[104; 105) | ||
89 | WHITESPACE@[105; 106) | ||
90 | EQ@[106; 107) | ||
91 | WHITESPACE@[107; 108) | ||
92 | TUPLE_EXPR@[108; 110) | ||
93 | L_PAREN@[108; 109) | ||
94 | R_PAREN@[109; 110) | ||
95 | SEMI@[110; 111) | ||
96 | WHITESPACE@[111; 116) | ||
97 | LET_STMT@[116; 143) | ||
98 | LET_KW@[116; 119) | ||
99 | WHITESPACE@[119; 120) | ||
100 | BIND_PAT@[120; 137) | ||
101 | REF_KW@[120; 123) | ||
102 | WHITESPACE@[123; 124) | ||
103 | MUT_KW@[124; 127) | ||
104 | WHITESPACE@[127; 128) | ||
105 | NAME@[128; 129) | ||
106 | IDENT@[128; 129) "f" | ||
107 | WHITESPACE@[129; 130) | ||
108 | AT@[130; 131) | ||
109 | WHITESPACE@[131; 132) | ||
110 | BIND_PAT@[132; 137) | ||
111 | NAME@[132; 133) | ||
112 | IDENT@[132; 133) "g" | ||
113 | WHITESPACE@[133; 134) | ||
114 | AT@[134; 135) | ||
115 | WHITESPACE@[135; 136) | ||
116 | PLACEHOLDER_PAT@[136; 137) | ||
117 | UNDERSCORE@[136; 137) | ||
118 | WHITESPACE@[137; 138) | ||
119 | EQ@[138; 139) | ||
120 | WHITESPACE@[139; 140) | ||
121 | TUPLE_EXPR@[140; 142) | ||
122 | L_PAREN@[140; 141) | ||
123 | R_PAREN@[141; 142) | ||
124 | SEMI@[142; 143) | ||
125 | WHITESPACE@[143; 144) | ||
126 | R_CURLY@[144; 145) | ||
127 | WHITESPACE@[145; 146) | ||