diff options
author | Aleksey Kladov <[email protected]> | 2020-04-11 22:33:17 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-11 23:00:15 +0100 |
commit | 5e5eb6a108b00c573455d8d088742592012707be (patch) | |
tree | 49146b7e25835f21c09f75ec56e129367f56cab0 /crates/ra_hir_expand | |
parent | 6b49e774e23c04a04ff5f377fc8dae25b5c69bb0 (diff) |
Align grammar for record patterns and literals
The grammar now looks like this
[name_ref :] pat
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r-- | crates/ra_hir_expand/src/name.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_hir_expand/src/name.rs b/crates/ra_hir_expand/src/name.rs index 25cc1e9fc..fecce224e 100644 --- a/crates/ra_hir_expand/src/name.rs +++ b/crates/ra_hir_expand/src/name.rs | |||
@@ -83,6 +83,15 @@ impl AsName for ast::Name { | |||
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
86 | impl AsName for ast::NameOrNameRef { | ||
87 | fn as_name(&self) -> Name { | ||
88 | match self { | ||
89 | ast::NameOrNameRef::Name(it) => it.as_name(), | ||
90 | ast::NameOrNameRef::NameRef(it) => it.as_name(), | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | |||
86 | impl AsName for tt::Ident { | 95 | impl AsName for tt::Ident { |
87 | fn as_name(&self) -> Name { | 96 | fn as_name(&self) -> Name { |
88 | Name::resolve(&self.text) | 97 | Name::resolve(&self.text) |