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/items.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 97642bc24..ffcdaaa99 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs @@ -304,7 +304,13 @@ fn extern_crate_item(p: &mut Parser, m: Marker) { p.bump(T![extern]); assert!(p.at(T![crate])); p.bump(T![crate]); - name_ref(p); + + if p.at(T![self]) { + p.bump(T![self]); + } else { + name_ref(p); + } + opt_alias(p); p.expect(T![;]); m.complete(p, EXTERN_CRATE_ITEM); -- cgit v1.2.3 From 2984da672e0c73d56501c6b6e4d19fd28152b5eb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 11:42:51 +0200 Subject: Split ItemList & AssocItemList --- crates/ra_parser/src/grammar/items/traits.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items/traits.rs b/crates/ra_parser/src/grammar/items/traits.rs index c819e33be..ef9c8ff5b 100644 --- a/crates/ra_parser/src/grammar/items/traits.rs +++ b/crates/ra_parser/src/grammar/items/traits.rs @@ -50,7 +50,7 @@ pub(crate) fn trait_item_list(p: &mut Parser) { item_or_macro(p, true, ItemFlavor::Trait); } p.expect(T!['}']); - m.complete(p, ITEM_LIST); + m.complete(p, ASSOC_ITEM_LIST); } // test impl_def @@ -107,7 +107,7 @@ pub(crate) fn impl_item_list(p: &mut Parser) { item_or_macro(p, true, ItemFlavor::Mod); } p.expect(T!['}']); - m.complete(p, ITEM_LIST); + m.complete(p, ASSOC_ITEM_LIST); } // test impl_type_params -- cgit v1.2.3 From d032f872b619c651dc66bfd669ef783108fc122c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 12:26:57 +0200 Subject: Finish extern crates grammar --- crates/ra_parser/src/grammar/items.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index ffcdaaa99..3b73e5346 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs @@ -313,7 +313,7 @@ fn extern_crate_item(p: &mut Parser, m: Marker) { opt_alias(p); p.expect(T![;]); - m.complete(p, EXTERN_CRATE_ITEM); + m.complete(p, EXTERN_CRATE); } pub(crate) fn extern_item_list(p: &mut Parser) { -- cgit v1.2.3 From b1332670c7c471a59f3da113b366e74ac194c38b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 14:12:04 +0200 Subject: Rename UseItem -> Use --- crates/ra_parser/src/grammar/items/use_item.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items/use_item.rs b/crates/ra_parser/src/grammar/items/use_item.rs index 3a0c7a31a..8e836a77e 100644 --- a/crates/ra_parser/src/grammar/items/use_item.rs +++ b/crates/ra_parser/src/grammar/items/use_item.rs @@ -7,7 +7,7 @@ pub(super) fn use_item(p: &mut Parser, m: Marker) { p.bump(T![use]); use_tree(p, true); p.expect(T![;]); - m.complete(p, USE_ITEM); + m.complete(p, USE); } /// Parse a use 'tree', such as `some::path` in `use some::path;` -- cgit v1.2.3 From 1142112c70b705f59b7d559d9d72cdc831865158 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 14:51:08 +0200 Subject: Rename FnDef -> Fn --- crates/ra_parser/src/grammar/items.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 3b73e5346..7f8a51ddb 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs @@ -180,7 +180,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul // unsafe const fn bar() {} T![fn] => { fn_def(p); - m.complete(p, FN_DEF); + m.complete(p, FN); } // test unsafe_trait -- cgit v1.2.3 From eb2f8063444b11257111f4f8ade990ec810e0361 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 15:25:46 +0200 Subject: Rename TypeAliasDef -> TypeAlias --- crates/ra_parser/src/grammar/items.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 7f8a51ddb..664b23f6a 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs @@ -380,7 +380,7 @@ fn type_def(p: &mut Parser, m: Marker) { types::type_(p); } p.expect(T![;]); - m.complete(p, TYPE_ALIAS_DEF); + m.complete(p, TYPE_ALIAS); } pub(crate) fn mod_item(p: &mut Parser, m: Marker) { -- cgit v1.2.3 From 28ef4c375a9f56d69daf885504aea3df7012bb81 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 15:36:21 +0200 Subject: Rename TypeParamList -> GenericParamList --- crates/ra_parser/src/grammar/type_params.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/type_params.rs b/crates/ra_parser/src/grammar/type_params.rs index d1330d4b9..90dabb4c0 100644 --- a/crates/ra_parser/src/grammar/type_params.rs +++ b/crates/ra_parser/src/grammar/type_params.rs @@ -36,7 +36,7 @@ fn type_param_list(p: &mut Parser) { } } p.expect(T![>]); - m.complete(p, TYPE_PARAM_LIST); + m.complete(p, GENERIC_PARAM_LIST); } fn lifetime_param(p: &mut Parser, m: Marker) { -- 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/expressions.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index 6e72eea66..e1c25a838 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs @@ -587,7 +587,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) { match p.current() { T!['{'] if !r.forbid_structs => { record_field_list(p); - (m.complete(p, RECORD_LIT), BlockLike::NotBlock) + (m.complete(p, RECORD_EXPR), BlockLike::NotBlock) } T![!] if !p.at(T![!=]) => { let block_like = items::macro_call_after_excl(p); @@ -627,7 +627,7 @@ pub(crate) fn record_field_list(p: &mut Parser) { p.expect(T![:]); } expr(p); - m.complete(p, RECORD_FIELD); + m.complete(p, RECORD_EXPR_FIELD); } T![.] if p.at(T![..]) => { m.abandon(p); @@ -648,5 +648,5 @@ pub(crate) fn record_field_list(p: &mut Parser) { } } p.expect(T!['}']); - m.complete(p, RECORD_FIELD_LIST); + m.complete(p, RECORD_EXPR_FIELD_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/items/adt.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/ra_parser/src/grammar/items/adt.rs index 74b9f514b..0e96bf77e 100644 --- a/crates/ra_parser/src/grammar/items/adt.rs +++ b/crates/ra_parser/src/grammar/items/adt.rs @@ -119,7 +119,7 @@ pub(crate) fn record_field_def_list(p: &mut Parser) { } } p.expect(T!['}']); - m.complete(p, RECORD_FIELD_DEF_LIST); + m.complete(p, RECORD_FIELD_LIST); fn record_field_def(p: &mut Parser) { let m = p.start(); @@ -134,7 +134,7 @@ pub(crate) fn record_field_def_list(p: &mut Parser) { name(p); p.expect(T![:]); types::type_(p); - m.complete(p, RECORD_FIELD_DEF); + m.complete(p, RECORD_FIELD); } else { m.abandon(p); p.err_and_bump("expected field declaration"); @@ -167,12 +167,12 @@ fn tuple_field_def_list(p: &mut Parser) { break; } types::type_(p); - m.complete(p, TUPLE_FIELD_DEF); + m.complete(p, TUPLE_FIELD); if !p.at(T![')']) { p.expect(T![,]); } } p.expect(T![')']); - m.complete(p, TUPLE_FIELD_DEF_LIST); + m.complete(p, TUPLE_FIELD_LIST); } -- cgit v1.2.3 From 1ae4721c9cfea746fce59a816b1c266bf373d6cf Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:36:46 +0200 Subject: Finalize union grammar --- crates/ra_parser/src/grammar/items/adt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/ra_parser/src/grammar/items/adt.rs index 0e96bf77e..ec06e2d45 100644 --- a/crates/ra_parser/src/grammar/items/adt.rs +++ b/crates/ra_parser/src/grammar/items/adt.rs @@ -11,7 +11,7 @@ pub(super) fn struct_def(p: &mut Parser, m: Marker) { pub(super) fn union_def(p: &mut Parser, m: Marker) { assert!(p.at_contextual_kw("union")); p.bump_remap(T![union]); - struct_or_union(p, m, T![union], UNION_DEF); + struct_or_union(p, m, T![union], UNION); } fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { -- cgit v1.2.3 From 216a5344c8ef3c3e430d2761dc8b1a7b60250a15 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:50:40 +0200 Subject: Rename StructDef -> Struct --- crates/ra_parser/src/grammar/items/adt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/ra_parser/src/grammar/items/adt.rs index ec06e2d45..2f5cfb6b6 100644 --- a/crates/ra_parser/src/grammar/items/adt.rs +++ b/crates/ra_parser/src/grammar/items/adt.rs @@ -5,7 +5,7 @@ use super::*; pub(super) fn struct_def(p: &mut Parser, m: Marker) { assert!(p.at(T![struct])); p.bump(T![struct]); - struct_or_union(p, m, T![struct], STRUCT_DEF); + struct_or_union(p, m, T![struct], STRUCT); } pub(super) fn union_def(p: &mut Parser, m: Marker) { -- cgit v1.2.3 From 609680ef97dbf82c07b6b06e21aa366423892304 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:52:53 +0200 Subject: Rename EnumDef -> Enum --- crates/ra_parser/src/grammar/items/adt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/ra_parser/src/grammar/items/adt.rs index 2f5cfb6b6..aeb7ce86b 100644 --- a/crates/ra_parser/src/grammar/items/adt.rs +++ b/crates/ra_parser/src/grammar/items/adt.rs @@ -64,7 +64,7 @@ pub(super) fn enum_def(p: &mut Parser, m: Marker) { } else { p.error("expected `{`") } - m.complete(p, ENUM_DEF); + m.complete(p, ENUM); } pub(crate) fn enum_variant_list(p: &mut Parser) { -- 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/items/adt.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/ra_parser/src/grammar/items/adt.rs index aeb7ce86b..addfb59d4 100644 --- a/crates/ra_parser/src/grammar/items/adt.rs +++ b/crates/ra_parser/src/grammar/items/adt.rs @@ -91,7 +91,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) { if p.eat(T![=]) { expressions::expr(p); } - var.complete(p, ENUM_VARIANT); + var.complete(p, VARIANT); } else { var.abandon(p); p.err_and_bump("expected enum variant"); @@ -101,7 +101,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) { } } p.expect(T!['}']); - m.complete(p, ENUM_VARIANT_LIST); + m.complete(p, VARIANT_LIST); } pub(crate) fn record_field_def_list(p: &mut Parser) { -- cgit v1.2.3 From 3cd4112bdc924c132cb0eab9d064511a215421ec Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:02:20 +0200 Subject: Finalize const&static grammar --- crates/ra_parser/src/grammar/items/consts.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items/consts.rs b/crates/ra_parser/src/grammar/items/consts.rs index 742a7e056..35ad766dc 100644 --- a/crates/ra_parser/src/grammar/items/consts.rs +++ b/crates/ra_parser/src/grammar/items/consts.rs @@ -3,11 +3,11 @@ use super::*; pub(super) fn static_def(p: &mut Parser, m: Marker) { - const_or_static(p, m, T![static], STATIC_DEF) + const_or_static(p, m, T![static], STATIC) } pub(super) fn const_def(p: &mut Parser, m: Marker) { - const_or_static(p, m, T![const], CONST_DEF) + const_or_static(p, m, T![const], CONST) } fn const_or_static(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { -- 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/items.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 664b23f6a..5603d61a9 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs @@ -193,7 +193,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul // unsafe auto trait T {} T![trait] => { traits::trait_def(p); - m.complete(p, TRAIT_DEF); + m.complete(p, TRAIT); } // test unsafe_impl -- 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/items.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 5603d61a9..cca524cea 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs @@ -221,7 +221,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul // unsafe default impl Foo {} T![impl] => { traits::impl_def(p); - m.complete(p, IMPL_DEF); + m.complete(p, IMPL); } // test existential_type -- cgit v1.2.3 From a6e45c6c69bf258118940941c12d057deb79e60c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 13:22:47 +0200 Subject: Reame PlaceholderType -> InferType --- crates/ra_parser/src/grammar/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs index 9e8e3bd97..e9a20fbf1 100644 --- a/crates/ra_parser/src/grammar/types.rs +++ b/crates/ra_parser/src/grammar/types.rs @@ -172,7 +172,7 @@ fn placeholder_type(p: &mut Parser) { assert!(p.at(T![_])); let m = p.start(); p.bump(T![_]); - m.complete(p, PLACEHOLDER_TYPE); + m.complete(p, INFER_TYPE); } // test fn_pointer_type -- cgit v1.2.3 From 633aace41108b74fe6c93c5ab04272067db033f9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 17:08:58 +0200 Subject: Rename LambdaExpr -> ClosureExpr --- crates/ra_parser/src/grammar/expressions/atom.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') 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 { p.error("expected expression"); } } - m.complete(p, LAMBDA_EXPR) + m.complete(p, CLOSURE_EXPR) } // test if_expr -- cgit v1.2.3 From 91781c7ce8201b28afd56b4e35eba47e076a8498 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 18:29:29 +0200 Subject: Rename TypeArgList -> GenericArgList --- crates/ra_parser/src/grammar/type_args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/type_args.rs b/crates/ra_parser/src/grammar/type_args.rs index 2d61f9d80..8f88d51db 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) { } } p.expect(T![>]); - m.complete(p, TYPE_ARG_LIST); + m.complete(p, GENERIC_ARG_LIST); } // test type_arg -- cgit v1.2.3 From ddf08daddf7e86d67e8d2e5596f8013b376dd522 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 18:46:07 +0200 Subject: Fix const arguments grammar --- crates/ra_parser/src/grammar/type_args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/type_args.rs b/crates/ra_parser/src/grammar/type_args.rs index 8f88d51db..aef7cd6fb 100644 --- a/crates/ra_parser/src/grammar/type_args.rs +++ b/crates/ra_parser/src/grammar/type_args.rs @@ -52,7 +52,7 @@ fn type_arg(p: &mut Parser) { m.complete(p, CONST_ARG); } k if k.is_literal() => { - p.bump(k); + expressions::literal(p); m.complete(p, CONST_ARG); } _ => { -- cgit v1.2.3 From 14cb96ec0e6be3b99bfe4ea373c058dcbd2a4f79 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 19:54:16 +0200 Subject: Allign RecordPat with RecordExpr --- crates/ra_parser/src/grammar/patterns.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/ra_parser/src/grammar/patterns.rs index 427c0eb49..d5dd9ffa2 100644 --- a/crates/ra_parser/src/grammar/patterns.rs +++ b/crates/ra_parser/src/grammar/patterns.rs @@ -217,7 +217,7 @@ fn record_field_pat_list(p: &mut Parser) { bind_pat(p, false); } } - m.complete(p, RECORD_FIELD_PAT); + m.complete(p, RECORD_PAT_FIELD); } } if !p.at(T!['}']) { @@ -225,7 +225,7 @@ fn record_field_pat_list(p: &mut Parser) { } } p.expect(T!['}']); - m.complete(p, RECORD_FIELD_PAT_LIST); + m.complete(p, RECORD_PAT_FIELD_LIST); } // test placeholder_pat -- cgit v1.2.3 From 6791eb9685375da94556bb910ea71f78b08be5ec Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 20:07:21 +0200 Subject: Rename PalceholderPat -> WildcardPat --- crates/ra_parser/src/grammar/patterns.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/ra_parser/src/grammar/patterns.rs index d5dd9ffa2..51e413cd6 100644 --- a/crates/ra_parser/src/grammar/patterns.rs +++ b/crates/ra_parser/src/grammar/patterns.rs @@ -234,7 +234,7 @@ fn placeholder_pat(p: &mut Parser) -> CompletedMarker { assert!(p.at(T![_])); let m = p.start(); p.bump(T![_]); - m.complete(p, PLACEHOLDER_PAT) + m.complete(p, WILDCARD_PAT) } // test dot_dot_pat -- cgit v1.2.3 From 98181087984157e27faba0b969e384f3c62c39d5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 20:09:09 +0200 Subject: Rename BindPat -> IdentPat --- crates/ra_parser/src/grammar/patterns.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/ra_parser/src/grammar/patterns.rs index 51e413cd6..623e8d6d4 100644 --- a/crates/ra_parser/src/grammar/patterns.rs +++ b/crates/ra_parser/src/grammar/patterns.rs @@ -361,7 +361,7 @@ fn bind_pat(p: &mut Parser, with_at: bool) -> CompletedMarker { if with_at && p.eat(T![@]) { pattern_single(p); } - m.complete(p, BIND_PAT) + m.complete(p, IDENT_PAT) } // test box_pat -- cgit v1.2.3 From 22d295ceaaee76dbd555cdeedc0ed7578e66279d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 21:45:29 +0200 Subject: Rename DotDotPat -> RestPat --- crates/ra_parser/src/grammar/patterns.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/ra_parser/src/grammar/patterns.rs index 623e8d6d4..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) { p.bump(T!['{']); while !p.at(EOF) && !p.at(T!['}']) { match p.current() { - // A trailing `..` is *not* treated as a DOT_DOT_PAT. + // A trailing `..` is *not* treated as a REST_PAT. T![.] if p.at(T![..]) => p.bump(T![..]), T!['{'] => error_block(p, "expected ident"), @@ -267,7 +267,7 @@ fn dot_dot_pat(p: &mut Parser) -> CompletedMarker { assert!(p.at(T![..])); let m = p.start(); p.bump(T![..]); - m.complete(p, DOT_DOT_PAT) + m.complete(p, REST_PAT) } // test ref_pat -- cgit v1.2.3 From bff8dd094958f1abe2fcfe8fe9f15dc7a7e6b53e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 1 Aug 2020 13:47:19 +0200 Subject: Update grammar --- crates/ra_parser/src/grammar/types.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs index e9a20fbf1..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) { }; type_no_bounds(p); - m.complete(p, POINTER_TYPE); + m.complete(p, PTR_TYPE); } fn array_or_slice_type(p: &mut Parser) { @@ -163,7 +163,7 @@ fn reference_type(p: &mut Parser) { p.eat(LIFETIME); p.eat(T![mut]); type_no_bounds(p); - m.complete(p, REFERENCE_TYPE); + m.complete(p, REF_TYPE); } // test placeholder_type @@ -201,7 +201,7 @@ fn fn_pointer_type(p: &mut Parser) { // test fn_pointer_type_with_ret // type F = fn() -> (); opt_fn_ret_type(p); - m.complete(p, FN_POINTER_TYPE); + m.complete(p, FN_PTR_TYPE); } pub(super) fn for_binder(p: &mut Parser) { -- cgit v1.2.3