aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/expressions.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-23 13:55:21 +0100
committerAleksey Kladov <[email protected]>2019-08-23 14:59:50 +0100
commit5b18a4eef9e69260ce2f105b33553c929cb7d827 (patch)
tree15f55b3eab48c3d0bbb1975fbd4db7cbb56d3e3e /crates/ra_parser/src/grammar/expressions.rs
parentc12dce0073c1766f7d2b10a69f8526a8093e70dc (diff)
rename struct -> record, pos -> tuple
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions.rs')
-rw-r--r--crates/ra_parser/src/grammar/expressions.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs
index 0495f34ae..783d6a6f0 100644
--- a/crates/ra_parser/src/grammar/expressions.rs
+++ b/crates/ra_parser/src/grammar/expressions.rs
@@ -559,8 +559,8 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) {
559 paths::expr_path(p); 559 paths::expr_path(p);
560 match p.current() { 560 match p.current() {
561 T!['{'] if !r.forbid_structs => { 561 T!['{'] if !r.forbid_structs => {
562 named_field_list(p); 562 record_field_list(p);
563 (m.complete(p, STRUCT_LIT), BlockLike::NotBlock) 563 (m.complete(p, RECORD_LIT), BlockLike::NotBlock)
564 } 564 }
565 T![!] => { 565 T![!] => {
566 let block_like = items::macro_call_after_excl(p); 566 let block_like = items::macro_call_after_excl(p);
@@ -570,20 +570,20 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) {
570 } 570 }
571} 571}
572 572
573// test struct_lit 573// test record_lit
574// fn foo() { 574// fn foo() {
575// S {}; 575// S {};
576// S { x, y: 32, }; 576// S { x, y: 32, };
577// S { x, y: 32, ..Default::default() }; 577// S { x, y: 32, ..Default::default() };
578// TupleStruct { 0: 1 }; 578// TupleStruct { 0: 1 };
579// } 579// }
580pub(crate) fn named_field_list(p: &mut Parser) { 580pub(crate) fn record_field_list(p: &mut Parser) {
581 assert!(p.at(T!['{'])); 581 assert!(p.at(T!['{']));
582 let m = p.start(); 582 let m = p.start();
583 p.bump(); 583 p.bump();
584 while !p.at(EOF) && !p.at(T!['}']) { 584 while !p.at(EOF) && !p.at(T!['}']) {
585 match p.current() { 585 match p.current() {
586 // test struct_literal_field_with_attr 586 // test record_literal_field_with_attr
587 // fn main() { 587 // fn main() {
588 // S { #[cfg(test)] field: 1 } 588 // S { #[cfg(test)] field: 1 }
589 // } 589 // }
@@ -594,7 +594,7 @@ pub(crate) fn named_field_list(p: &mut Parser) {
594 if p.eat(T![:]) { 594 if p.eat(T![:]) {
595 expr(p); 595 expr(p);
596 } 596 }
597 m.complete(p, NAMED_FIELD); 597 m.complete(p, RECORD_FIELD);
598 } 598 }
599 T![..] => { 599 T![..] => {
600 p.bump(); 600 p.bump();
@@ -608,5 +608,5 @@ pub(crate) fn named_field_list(p: &mut Parser) {
608 } 608 }
609 } 609 }
610 p.expect(T!['}']); 610 p.expect(T!['}']);
611 m.complete(p, NAMED_FIELD_LIST); 611 m.complete(p, RECORD_FIELD_LIST);
612} 612}