diff options
Diffstat (limited to 'crates/ra_parser/src')
-rw-r--r-- | crates/ra_parser/src/grammar/expressions.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index bf5d6544d..9b38b0a31 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs | |||
@@ -379,6 +379,14 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | |||
379 | // fn foo() { | 379 | // fn foo() { |
380 | // x.foo; | 380 | // x.foo; |
381 | // x.0.bar; | 381 | // x.0.bar; |
382 | // x.0(); | ||
383 | // } | ||
384 | |||
385 | // test_err bad_tuple_index_expr | ||
386 | // fn foo() { | ||
387 | // x.0.; | ||
388 | // x.1i32; | ||
389 | // x.0x01; | ||
382 | // } | 390 | // } |
383 | fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | 391 | fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { |
384 | assert!(p.at(DOT)); | 392 | assert!(p.at(DOT)); |
@@ -387,7 +395,10 @@ fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | |||
387 | if p.at(IDENT) { | 395 | if p.at(IDENT) { |
388 | name_ref(p) | 396 | name_ref(p) |
389 | } else if p.at(INT_NUMBER) { | 397 | } else if p.at(INT_NUMBER) { |
390 | p.bump() | 398 | p.bump(); |
399 | } else if p.at(FLOAT_NUMBER) { | ||
400 | // FIXME: How to recover and instead parse INT + DOT? | ||
401 | p.bump(); | ||
391 | } else { | 402 | } else { |
392 | p.error("expected field name or number") | 403 | p.error("expected field name or number") |
393 | } | 404 | } |