From b10e437039c2d7e300f6be6b5de6446419a2d660 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Jul 2020 20:59:48 +0200 Subject: Fix nameref parsing --- crates/ra_parser/src/grammar.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'crates/ra_parser/src/grammar.rs') diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index caedeead0..de2c98afd 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs @@ -270,10 +270,6 @@ fn name_ref(p: &mut Parser) { let m = p.start(); p.bump(IDENT); m.complete(p, NAME_REF); - } else if p.at(T![self]) { - let m = p.start(); - p.bump(T![self]); - m.complete(p, T![self]); } else { p.err_and_bump("expected identifier"); } -- cgit v1.2.3 From 081f35fe1b311223866fa5fc7edde2e8048cd901 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 11:48:19 +0200 Subject: Update tests --- crates/ra_parser/src/grammar.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_parser/src/grammar.rs') diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index de2c98afd..3350e23b9 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs @@ -149,12 +149,12 @@ pub(crate) fn reparser( USE_TREE_LIST => items::use_tree_list, EXTERN_ITEM_LIST => items::extern_item_list, TOKEN_TREE if first_child? == T!['{'] => items::token_tree, - ITEM_LIST => match parent? { + ASSOC_ITEM_LIST => match parent? { IMPL_DEF => items::impl_item_list, TRAIT_DEF => items::trait_item_list, - MODULE => items::mod_item_list, _ => return None, }, + ITEM_LIST => items::mod_item_list, _ => return None, }; Some(res) -- cgit v1.2.3 From 6cd2131cafd29ae17442efbcce652bd447576f27 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 11:58:41 +0200 Subject: Rename Rename --- crates/ra_parser/src/grammar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar.rs') diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index 3350e23b9..7dfac2813 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs @@ -224,7 +224,7 @@ fn opt_alias(p: &mut Parser) { if !p.eat(T![_]) { name(p); } - m.complete(p, ALIAS); + m.complete(p, RENAME); } } -- cgit v1.2.3 From 6f8aa75329d0a4e588e58b8f22f7932bf3d3a706 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 16:21:30 +0200 Subject: Rename RecordLit -> RecordExpr --- crates/ra_parser/src/grammar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar.rs') diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index 7dfac2813..3610e7392 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs @@ -143,7 +143,7 @@ pub(crate) fn reparser( let res = match node { BLOCK_EXPR => expressions::block_expr, RECORD_FIELD_DEF_LIST => items::record_field_def_list, - RECORD_FIELD_LIST => items::record_field_list, + RECORD_EXPR_FIELD_LIST => items::record_field_list, ENUM_VARIANT_LIST => items::enum_variant_list, MATCH_ARM_LIST => items::match_arm_list, USE_TREE_LIST => items::use_tree_list, -- cgit v1.2.3 From 0a9e3ccc262fbcbd4cdaab30384f8cb71584544b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 16:49:13 +0200 Subject: Rename FieldDef -> Field --- crates/ra_parser/src/grammar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar.rs') diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index 3610e7392..03041d110 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs @@ -142,7 +142,7 @@ pub(crate) fn reparser( ) -> Option { let res = match node { BLOCK_EXPR => expressions::block_expr, - RECORD_FIELD_DEF_LIST => items::record_field_def_list, + RECORD_FIELD_LIST => items::record_field_def_list, RECORD_EXPR_FIELD_LIST => items::record_field_list, ENUM_VARIANT_LIST => items::enum_variant_list, MATCH_ARM_LIST => items::match_arm_list, -- cgit v1.2.3 From 1766aae145c6925a33e427f2fe6ef2a56c301665 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:56:53 +0200 Subject: Rename EnumVariant -> Variant --- crates/ra_parser/src/grammar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar.rs') diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index 03041d110..22a7acdf3 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs @@ -144,7 +144,7 @@ pub(crate) fn reparser( BLOCK_EXPR => expressions::block_expr, RECORD_FIELD_LIST => items::record_field_def_list, RECORD_EXPR_FIELD_LIST => items::record_field_list, - ENUM_VARIANT_LIST => items::enum_variant_list, + VARIANT_LIST => items::enum_variant_list, MATCH_ARM_LIST => items::match_arm_list, USE_TREE_LIST => items::use_tree_list, EXTERN_ITEM_LIST => items::extern_item_list, -- cgit v1.2.3 From c83467796b6c7365ea4f41900d74444384a9e618 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:17:28 +0200 Subject: Finalize Trait grammar --- crates/ra_parser/src/grammar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar.rs') diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index 22a7acdf3..cd4b2381d 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs @@ -151,7 +151,7 @@ pub(crate) fn reparser( TOKEN_TREE if first_child? == T!['{'] => items::token_tree, ASSOC_ITEM_LIST => match parent? { IMPL_DEF => items::impl_item_list, - TRAIT_DEF => items::trait_item_list, + TRAIT => items::trait_item_list, _ => return None, }, ITEM_LIST => items::mod_item_list, -- cgit v1.2.3 From c5798c4d75aa807aec47208a49101bdec3affcca Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:28:28 +0200 Subject: Finalize impl Grammar --- crates/ra_parser/src/grammar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar.rs') diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index cd4b2381d..c2e1d701e 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs @@ -150,7 +150,7 @@ pub(crate) fn reparser( EXTERN_ITEM_LIST => items::extern_item_list, TOKEN_TREE if first_child? == T!['{'] => items::token_tree, ASSOC_ITEM_LIST => match parent? { - IMPL_DEF => items::impl_item_list, + IMPL => items::impl_item_list, TRAIT => items::trait_item_list, _ => return None, }, -- cgit v1.2.3