diff options
Diffstat (limited to 'crates/syntax/test_data/parser/inline')
7 files changed, 208 insertions, 29 deletions
diff --git a/crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rast b/crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rast index 3016a6574..1ff3f7656 100644 --- a/crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rast +++ b/crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rast | |||
@@ -7,15 +7,16 @@ [email protected] | |||
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] "=" | 8 | [email protected] "=" |
9 | [email protected] " " | 9 | [email protected] " " |
10 | [email protected] | 10 | [email protected] |
11 | [email protected] | 11 | [email protected] |
12 | [email protected] | 12 | [email protected] |
13 | [email protected] | 13 | [email protected] |
14 | [email protected] "foo" | 14 | [email protected] |
15 | [email protected] "!" | 15 | [email protected] "foo" |
16 | [email protected] | 16 | [email protected] "!" |
17 | [email protected] "(" | 17 | [email protected] |
18 | [email protected] ")" | 18 | [email protected] "(" |
19 | [email protected] ")" | ||
19 | [email protected] ";" | 20 | [email protected] ";" |
20 | [email protected] "\n" | 21 | [email protected] "\n" |
21 | [email protected] | 22 | [email protected] |
@@ -26,19 +27,20 @@ [email protected] | |||
26 | [email protected] " " | 27 | [email protected] " " |
27 | [email protected] "=" | 28 | [email protected] "=" |
28 | [email protected] " " | 29 | [email protected] " " |
29 | [email protected] | 30 | [email protected] |
30 | [email protected] | 31 | [email protected] |
31 | [email protected] | 32 | [email protected] |
32 | [email protected] | 33 | [email protected] |
33 | [email protected] | 34 | [email protected] |
34 | [email protected] "crate" | 35 | [email protected] |
35 | [email protected] "::" | 36 | [email protected] "crate" |
36 | [email protected] | 37 | [email protected] "::" |
37 | [email protected] | 38 | [email protected] |
38 | [email protected] "foo" | 39 | [email protected] |
39 | [email protected] "!" | 40 | [email protected] "foo" |
40 | [email protected] | 41 | [email protected] "!" |
41 | [email protected] "(" | 42 | [email protected] |
42 | [email protected] ")" | 43 | [email protected] "(" |
44 | [email protected] ")" | ||
43 | [email protected] ";" | 45 | [email protected] ";" |
44 | [email protected] "\n" | 46 | [email protected] "\n" |
diff --git a/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast b/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast index 925409bdf..e9202a612 100644 --- a/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast +++ b/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..63 | 1 | SOURCE_FILE@0..102 |
2 | FN@0..62 | 2 | FN@0..101 |
3 | [email protected] "fn" | 3 | [email protected] "fn" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] "(" | 8 | [email protected] "(" |
9 | [email protected] ")" | 9 | [email protected] ")" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | BLOCK_EXPR@9..62 | 11 | BLOCK_EXPR@9..101 |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
@@ -70,6 +70,52 @@ [email protected] | |||
70 | [email protected] "(" | 70 | [email protected] "(" |
71 | [email protected] ")" | 71 | [email protected] ")" |
72 | [email protected] ";" | 72 | [email protected] ";" |
73 | [email protected] "\n" | 73 | [email protected] "\n " |
74 | [email protected] "}" | 74 | [email protected] |
75 | [email protected] "\n" | 75 | [email protected] "let" |
76 | [email protected] " " | ||
77 | [email protected] | ||
78 | [email protected] | ||
79 | [email protected] | ||
80 | [email protected] | ||
81 | [email protected] "S" | ||
82 | [email protected] " " | ||
83 | [email protected] | ||
84 | [email protected] "{" | ||
85 | [email protected] " " | ||
86 | [email protected] | ||
87 | [email protected] | ||
88 | [email protected] "#" | ||
89 | [email protected] "[" | ||
90 | [email protected] | ||
91 | [email protected] | ||
92 | [email protected] | ||
93 | [email protected] "cfg" | ||
94 | [email protected] | ||
95 | [email protected] "(" | ||
96 | [email protected] "any" | ||
97 | [email protected] | ||
98 | [email protected] "(" | ||
99 | [email protected] ")" | ||
100 | [email protected] ")" | ||
101 | [email protected] "]" | ||
102 | [email protected] " " | ||
103 | [email protected] | ||
104 | [email protected] "x" | ||
105 | [email protected] ":" | ||
106 | [email protected] " " | ||
107 | [email protected] | ||
108 | [email protected] | ||
109 | [email protected] "1" | ||
110 | [email protected] " " | ||
111 | [email protected] "}" | ||
112 | [email protected] " " | ||
113 | [email protected] "=" | ||
114 | [email protected] " " | ||
115 | [email protected] | ||
116 | [email protected] "(" | ||
117 | [email protected] ")" | ||
118 | [email protected] ";" | ||
119 | [email protected] "\n" | ||
120 | [email protected] "}" | ||
121 | [email protected] "\n" | ||
diff --git a/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rs b/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rs index 26b1d5f89..53cfdc22d 100644 --- a/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rs +++ b/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rs | |||
@@ -1,4 +1,5 @@ | |||
1 | fn foo() { | 1 | fn foo() { |
2 | let S { 0: 1 } = (); | 2 | let S { 0: 1 } = (); |
3 | let S { x: 1 } = (); | 3 | let S { x: 1 } = (); |
4 | let S { #[cfg(any())] x: 1 } = (); | ||
4 | } | 5 | } |
diff --git a/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rast b/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rast new file mode 100644 index 000000000..b20e523dc --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rast | |||
@@ -0,0 +1,30 @@ | |||
1 | [email protected] | ||
2 | [email protected] | ||
3 | [email protected] "fn" | ||
4 | [email protected] " " | ||
5 | [email protected] | ||
6 | [email protected] "f" | ||
7 | [email protected] | ||
8 | [email protected] "(" | ||
9 | [email protected] ")" | ||
10 | [email protected] " " | ||
11 | [email protected] | ||
12 | [email protected] "{" | ||
13 | [email protected] " " | ||
14 | [email protected] | ||
15 | [email protected] | ||
16 | [email protected] | ||
17 | [email protected] | ||
18 | [email protected] "S" | ||
19 | [email protected] | ||
20 | [email protected] "::" | ||
21 | [email protected] "<" | ||
22 | [email protected] | ||
23 | [email protected] | ||
24 | [email protected] "-" | ||
25 | [email protected] | ||
26 | [email protected] "1" | ||
27 | [email protected] ">" | ||
28 | [email protected] " " | ||
29 | [email protected] "}" | ||
30 | [email protected] "\n" | ||
diff --git a/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rs b/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rs new file mode 100644 index 000000000..8a81d05cd --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rs | |||
@@ -0,0 +1 @@ | |||
fn f() { S::<-1> } | |||
diff --git a/crates/syntax/test_data/parser/inline/ok/0165_const_param_defaults.rast b/crates/syntax/test_data/parser/inline/ok/0165_const_param_defaults.rast new file mode 100644 index 000000000..e8f40a4cd --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0165_const_param_defaults.rast | |||
@@ -0,0 +1,96 @@ | |||
1 | [email protected] | ||
2 | [email protected] | ||
3 | [email protected] "struct" | ||
4 | [email protected] " " | ||
5 | [email protected] | ||
6 | [email protected] "A" | ||
7 | [email protected] | ||
8 | [email protected] "<" | ||
9 | [email protected] | ||
10 | [email protected] "const" | ||
11 | [email protected] " " | ||
12 | [email protected] | ||
13 | [email protected] "N" | ||
14 | [email protected] ":" | ||
15 | [email protected] " " | ||
16 | [email protected] | ||
17 | [email protected] | ||
18 | [email protected] | ||
19 | [email protected] | ||
20 | [email protected] "i32" | ||
21 | [email protected] " " | ||
22 | [email protected] "=" | ||
23 | [email protected] " " | ||
24 | [email protected] | ||
25 | [email protected] | ||
26 | [email protected] "-" | ||
27 | [email protected] | ||
28 | [email protected] "1" | ||
29 | [email protected] ">" | ||
30 | [email protected] ";" | ||
31 | [email protected] "\n" | ||
32 | [email protected] | ||
33 | [email protected] "struct" | ||
34 | [email protected] " " | ||
35 | [email protected] | ||
36 | [email protected] "B" | ||
37 | [email protected] | ||
38 | [email protected] "<" | ||
39 | [email protected] | ||
40 | [email protected] "const" | ||
41 | [email protected] " " | ||
42 | [email protected] | ||
43 | [email protected] "N" | ||
44 | [email protected] ":" | ||
45 | [email protected] " " | ||
46 | [email protected] | ||
47 | [email protected] | ||
48 | [email protected] | ||
49 | [email protected] | ||
50 | [email protected] "i32" | ||
51 | [email protected] " " | ||
52 | [email protected] "=" | ||
53 | [email protected] " " | ||
54 | [email protected] | ||
55 | [email protected] | ||
56 | [email protected] "{" | ||
57 | [email protected] "}" | ||
58 | [email protected] ">" | ||
59 | [email protected] ";" | ||
60 | [email protected] "\n" | ||
61 | [email protected] | ||
62 | [email protected] "struct" | ||
63 | [email protected] " " | ||
64 | [email protected] | ||
65 | [email protected] "C" | ||
66 | [email protected] | ||
67 | [email protected] "<" | ||
68 | [email protected] | ||
69 | [email protected] "const" | ||
70 | [email protected] " " | ||
71 | [email protected] | ||
72 | [email protected] "N" | ||
73 | [email protected] ":" | ||
74 | [email protected] " " | ||
75 | [email protected] | ||
76 | [email protected] | ||
77 | [email protected] | ||
78 | [email protected] | ||
79 | [email protected] "i32" | ||
80 | [email protected] " " | ||
81 | [email protected] "=" | ||
82 | [email protected] " " | ||
83 | [email protected] | ||
84 | [email protected] | ||
85 | [email protected] | ||
86 | [email protected] | ||
87 | [email protected] | ||
88 | [email protected] | ||
89 | [email protected] "some" | ||
90 | [email protected] "::" | ||
91 | [email protected] | ||
92 | [email protected] | ||
93 | [email protected] "CONST" | ||
94 | [email protected] ">" | ||
95 | [email protected] ";" | ||
96 | [email protected] "\n" | ||
diff --git a/crates/syntax/test_data/parser/inline/ok/0165_const_param_defaults.rs b/crates/syntax/test_data/parser/inline/ok/0165_const_param_defaults.rs new file mode 100644 index 000000000..68388c8fb --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0165_const_param_defaults.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | struct A<const N: i32 = -1>; | ||
2 | struct B<const N: i32 = {}>; | ||
3 | struct C<const N: i32 = some::CONST>; | ||