diff options
author | Marcus Klaas de Vries <[email protected]> | 2019-01-16 18:35:27 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-19 12:37:25 +0000 |
commit | ab5deb78117693d776723bc0144e7b34e6f782d1 (patch) | |
tree | 06a1de31ffc6d9d75315829cd7aebce43b44e009 /crates/ra_syntax/src/ast/generated.rs | |
parent | 9c2d83a4c809b0b11ca389bb454e197859e5116c (diff) |
Create struct patterns up to the hir level
Diffstat (limited to 'crates/ra_syntax/src/ast/generated.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 2fd146bf1..251d53bdf 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -2156,7 +2156,6 @@ pub enum PatKind<'a> { | |||
2156 | PlaceholderPat(&'a PlaceholderPat), | 2156 | PlaceholderPat(&'a PlaceholderPat), |
2157 | PathPat(&'a PathPat), | 2157 | PathPat(&'a PathPat), |
2158 | StructPat(&'a StructPat), | 2158 | StructPat(&'a StructPat), |
2159 | FieldPatList(&'a FieldPatList), | ||
2160 | TupleStructPat(&'a TupleStructPat), | 2159 | TupleStructPat(&'a TupleStructPat), |
2161 | TuplePat(&'a TuplePat), | 2160 | TuplePat(&'a TuplePat), |
2162 | SlicePat(&'a SlicePat), | 2161 | SlicePat(&'a SlicePat), |
@@ -2171,7 +2170,6 @@ impl AstNode for Pat { | |||
2171 | | PLACEHOLDER_PAT | 2170 | | PLACEHOLDER_PAT |
2172 | | PATH_PAT | 2171 | | PATH_PAT |
2173 | | STRUCT_PAT | 2172 | | STRUCT_PAT |
2174 | | FIELD_PAT_LIST | ||
2175 | | TUPLE_STRUCT_PAT | 2173 | | TUPLE_STRUCT_PAT |
2176 | | TUPLE_PAT | 2174 | | TUPLE_PAT |
2177 | | SLICE_PAT | 2175 | | SLICE_PAT |
@@ -2191,7 +2189,6 @@ impl Pat { | |||
2191 | PLACEHOLDER_PAT => PatKind::PlaceholderPat(PlaceholderPat::cast(&self.syntax).unwrap()), | 2189 | PLACEHOLDER_PAT => PatKind::PlaceholderPat(PlaceholderPat::cast(&self.syntax).unwrap()), |
2192 | PATH_PAT => PatKind::PathPat(PathPat::cast(&self.syntax).unwrap()), | 2190 | PATH_PAT => PatKind::PathPat(PathPat::cast(&self.syntax).unwrap()), |
2193 | STRUCT_PAT => PatKind::StructPat(StructPat::cast(&self.syntax).unwrap()), | 2191 | STRUCT_PAT => PatKind::StructPat(StructPat::cast(&self.syntax).unwrap()), |
2194 | FIELD_PAT_LIST => PatKind::FieldPatList(FieldPatList::cast(&self.syntax).unwrap()), | ||
2195 | TUPLE_STRUCT_PAT => PatKind::TupleStructPat(TupleStructPat::cast(&self.syntax).unwrap()), | 2192 | TUPLE_STRUCT_PAT => PatKind::TupleStructPat(TupleStructPat::cast(&self.syntax).unwrap()), |
2196 | TUPLE_PAT => PatKind::TuplePat(TuplePat::cast(&self.syntax).unwrap()), | 2193 | TUPLE_PAT => PatKind::TuplePat(TuplePat::cast(&self.syntax).unwrap()), |
2197 | SLICE_PAT => PatKind::SlicePat(SlicePat::cast(&self.syntax).unwrap()), | 2194 | SLICE_PAT => PatKind::SlicePat(SlicePat::cast(&self.syntax).unwrap()), |
@@ -3066,7 +3063,15 @@ impl AstNode for StructPat { | |||
3066 | } | 3063 | } |
3067 | 3064 | ||
3068 | 3065 | ||
3069 | impl StructPat {} | 3066 | impl StructPat { |
3067 | pub fn field_pat_list(&self) -> Option<&FieldPatList> { | ||
3068 | super::child_opt(self) | ||
3069 | } | ||
3070 | |||
3071 | pub fn path(&self) -> Option<&Path> { | ||
3072 | super::child_opt(self) | ||
3073 | } | ||
3074 | } | ||
3070 | 3075 | ||
3071 | // TokenTree | 3076 | // TokenTree |
3072 | #[derive(Debug, PartialEq, Eq, Hash)] | 3077 | #[derive(Debug, PartialEq, Eq, Hash)] |