diff options
Diffstat (limited to 'crates/ra_parser/src/grammar')
-rw-r--r-- | crates/ra_parser/src/grammar/expressions/atom.rs | 2 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/patterns.rs | 12 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/type_args.rs | 4 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/types.rs | 8 |
4 files changed, 13 insertions, 13 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index 706a2f796..0b01d3bc6 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs | |||
@@ -250,7 +250,7 @@ fn lambda_expr(p: &mut Parser) -> CompletedMarker { | |||
250 | p.error("expected expression"); | 250 | p.error("expected expression"); |
251 | } | 251 | } |
252 | } | 252 | } |
253 | m.complete(p, LAMBDA_EXPR) | 253 | m.complete(p, CLOSURE_EXPR) |
254 | } | 254 | } |
255 | 255 | ||
256 | // test if_expr | 256 | // test if_expr |
diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/ra_parser/src/grammar/patterns.rs index 427c0eb49..716bdc978 100644 --- a/crates/ra_parser/src/grammar/patterns.rs +++ b/crates/ra_parser/src/grammar/patterns.rs | |||
@@ -192,7 +192,7 @@ fn record_field_pat_list(p: &mut Parser) { | |||
192 | p.bump(T!['{']); | 192 | p.bump(T!['{']); |
193 | while !p.at(EOF) && !p.at(T!['}']) { | 193 | while !p.at(EOF) && !p.at(T!['}']) { |
194 | match p.current() { | 194 | match p.current() { |
195 | // A trailing `..` is *not* treated as a DOT_DOT_PAT. | 195 | // A trailing `..` is *not* treated as a REST_PAT. |
196 | T![.] if p.at(T![..]) => p.bump(T![..]), | 196 | T![.] if p.at(T![..]) => p.bump(T![..]), |
197 | T!['{'] => error_block(p, "expected ident"), | 197 | T!['{'] => error_block(p, "expected ident"), |
198 | 198 | ||
@@ -217,7 +217,7 @@ fn record_field_pat_list(p: &mut Parser) { | |||
217 | bind_pat(p, false); | 217 | bind_pat(p, false); |
218 | } | 218 | } |
219 | } | 219 | } |
220 | m.complete(p, RECORD_FIELD_PAT); | 220 | m.complete(p, RECORD_PAT_FIELD); |
221 | } | 221 | } |
222 | } | 222 | } |
223 | if !p.at(T!['}']) { | 223 | if !p.at(T!['}']) { |
@@ -225,7 +225,7 @@ fn record_field_pat_list(p: &mut Parser) { | |||
225 | } | 225 | } |
226 | } | 226 | } |
227 | p.expect(T!['}']); | 227 | p.expect(T!['}']); |
228 | m.complete(p, RECORD_FIELD_PAT_LIST); | 228 | m.complete(p, RECORD_PAT_FIELD_LIST); |
229 | } | 229 | } |
230 | 230 | ||
231 | // test placeholder_pat | 231 | // test placeholder_pat |
@@ -234,7 +234,7 @@ fn placeholder_pat(p: &mut Parser) -> CompletedMarker { | |||
234 | assert!(p.at(T![_])); | 234 | assert!(p.at(T![_])); |
235 | let m = p.start(); | 235 | let m = p.start(); |
236 | p.bump(T![_]); | 236 | p.bump(T![_]); |
237 | m.complete(p, PLACEHOLDER_PAT) | 237 | m.complete(p, WILDCARD_PAT) |
238 | } | 238 | } |
239 | 239 | ||
240 | // test dot_dot_pat | 240 | // test dot_dot_pat |
@@ -267,7 +267,7 @@ fn dot_dot_pat(p: &mut Parser) -> CompletedMarker { | |||
267 | assert!(p.at(T![..])); | 267 | assert!(p.at(T![..])); |
268 | let m = p.start(); | 268 | let m = p.start(); |
269 | p.bump(T![..]); | 269 | p.bump(T![..]); |
270 | m.complete(p, DOT_DOT_PAT) | 270 | m.complete(p, REST_PAT) |
271 | } | 271 | } |
272 | 272 | ||
273 | // test ref_pat | 273 | // test ref_pat |
@@ -361,7 +361,7 @@ fn bind_pat(p: &mut Parser, with_at: bool) -> CompletedMarker { | |||
361 | if with_at && p.eat(T![@]) { | 361 | if with_at && p.eat(T![@]) { |
362 | pattern_single(p); | 362 | pattern_single(p); |
363 | } | 363 | } |
364 | m.complete(p, BIND_PAT) | 364 | m.complete(p, IDENT_PAT) |
365 | } | 365 | } |
366 | 366 | ||
367 | // test box_pat | 367 | // test box_pat |
diff --git a/crates/ra_parser/src/grammar/type_args.rs b/crates/ra_parser/src/grammar/type_args.rs index 2d61f9d80..aef7cd6fb 100644 --- a/crates/ra_parser/src/grammar/type_args.rs +++ b/crates/ra_parser/src/grammar/type_args.rs | |||
@@ -22,7 +22,7 @@ pub(super) fn opt_type_arg_list(p: &mut Parser, colon_colon_required: bool) { | |||
22 | } | 22 | } |
23 | } | 23 | } |
24 | p.expect(T![>]); | 24 | p.expect(T![>]); |
25 | m.complete(p, TYPE_ARG_LIST); | 25 | m.complete(p, GENERIC_ARG_LIST); |
26 | } | 26 | } |
27 | 27 | ||
28 | // test type_arg | 28 | // test type_arg |
@@ -52,7 +52,7 @@ fn type_arg(p: &mut Parser) { | |||
52 | m.complete(p, CONST_ARG); | 52 | m.complete(p, CONST_ARG); |
53 | } | 53 | } |
54 | k if k.is_literal() => { | 54 | k if k.is_literal() => { |
55 | p.bump(k); | 55 | expressions::literal(p); |
56 | m.complete(p, CONST_ARG); | 56 | m.complete(p, CONST_ARG); |
57 | } | 57 | } |
58 | _ => { | 58 | _ => { |
diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs index 9e8e3bd97..0aa173a52 100644 --- a/crates/ra_parser/src/grammar/types.rs +++ b/crates/ra_parser/src/grammar/types.rs | |||
@@ -117,7 +117,7 @@ fn pointer_type(p: &mut Parser) { | |||
117 | }; | 117 | }; |
118 | 118 | ||
119 | type_no_bounds(p); | 119 | type_no_bounds(p); |
120 | m.complete(p, POINTER_TYPE); | 120 | m.complete(p, PTR_TYPE); |
121 | } | 121 | } |
122 | 122 | ||
123 | fn array_or_slice_type(p: &mut Parser) { | 123 | fn array_or_slice_type(p: &mut Parser) { |
@@ -163,7 +163,7 @@ fn reference_type(p: &mut Parser) { | |||
163 | p.eat(LIFETIME); | 163 | p.eat(LIFETIME); |
164 | p.eat(T![mut]); | 164 | p.eat(T![mut]); |
165 | type_no_bounds(p); | 165 | type_no_bounds(p); |
166 | m.complete(p, REFERENCE_TYPE); | 166 | m.complete(p, REF_TYPE); |
167 | } | 167 | } |
168 | 168 | ||
169 | // test placeholder_type | 169 | // test placeholder_type |
@@ -172,7 +172,7 @@ fn placeholder_type(p: &mut Parser) { | |||
172 | assert!(p.at(T![_])); | 172 | assert!(p.at(T![_])); |
173 | let m = p.start(); | 173 | let m = p.start(); |
174 | p.bump(T![_]); | 174 | p.bump(T![_]); |
175 | m.complete(p, PLACEHOLDER_TYPE); | 175 | m.complete(p, INFER_TYPE); |
176 | } | 176 | } |
177 | 177 | ||
178 | // test fn_pointer_type | 178 | // test fn_pointer_type |
@@ -201,7 +201,7 @@ fn fn_pointer_type(p: &mut Parser) { | |||
201 | // test fn_pointer_type_with_ret | 201 | // test fn_pointer_type_with_ret |
202 | // type F = fn() -> (); | 202 | // type F = fn() -> (); |
203 | opt_fn_ret_type(p); | 203 | opt_fn_ret_type(p); |
204 | m.complete(p, FN_POINTER_TYPE); | 204 | m.complete(p, FN_PTR_TYPE); |
205 | } | 205 | } |
206 | 206 | ||
207 | pub(super) fn for_binder(p: &mut Parser) { | 207 | pub(super) fn for_binder(p: &mut Parser) { |