aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/expressions.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-09 11:16:47 +0100
committerAleksey Kladov <[email protected]>2019-08-09 11:16:47 +0100
commitf3ee5a15090d8ba6ec220e1f907ed3af27e57734 (patch)
treed4042c35679ca1e4db06fd9976d90d025fca0966 /crates/ra_parser/src/grammar/expressions.rs
parent5f82012779c374d9f6b518634aefb14ce28e17e6 (diff)
Move numeric names inside of `NameRef`
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions.rs')
-rw-r--r--crates/ra_parser/src/grammar/expressions.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs
index 9f9e9cb0e..9fd3a235d 100644
--- a/crates/ra_parser/src/grammar/expressions.rs
+++ b/crates/ra_parser/src/grammar/expressions.rs
@@ -458,7 +458,7 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
458 assert!(p.at(T![.]) && p.nth(1) == IDENT && (p.nth(2) == T!['('] || p.nth(2) == T![::])); 458 assert!(p.at(T![.]) && p.nth(1) == IDENT && (p.nth(2) == T!['('] || p.nth(2) == T![::]));
459 let m = lhs.precede(p); 459 let m = lhs.precede(p);
460 p.bump(); 460 p.bump();
461 name_ref(p, false); 461 name_ref(p);
462 type_args::opt_type_arg_list(p, true); 462 type_args::opt_type_arg_list(p, true);
463 if p.at(T!['(']) { 463 if p.at(T!['(']) {
464 arg_list(p); 464 arg_list(p);
@@ -484,10 +484,8 @@ fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
484 assert!(p.at(T![.])); 484 assert!(p.at(T![.]));
485 let m = lhs.precede(p); 485 let m = lhs.precede(p);
486 p.bump(); 486 p.bump();
487 if p.at(IDENT) { 487 if p.at(IDENT) || p.at(INT_NUMBER) {
488 name_ref(p, false) 488 name_ref_or_index(p)
489 } else if p.at(INT_NUMBER) {
490 p.bump();
491 } else if p.at(FLOAT_NUMBER) { 489 } else if p.at(FLOAT_NUMBER) {
492 // FIXME: How to recover and instead parse INT + T![.]? 490 // FIXME: How to recover and instead parse INT + T![.]?
493 p.bump(); 491 p.bump();
@@ -587,7 +585,7 @@ pub(crate) fn named_field_list(p: &mut Parser) {
587 IDENT | INT_NUMBER | T![#] => { 585 IDENT | INT_NUMBER | T![#] => {
588 let m = p.start(); 586 let m = p.start();
589 attributes::outer_attributes(p); 587 attributes::outer_attributes(p);
590 name_ref(p, true); 588 name_ref_or_index(p);
591 if p.eat(T![:]) { 589 if p.eat(T![:]) {
592 expr(p); 590 expr(p);
593 } 591 }