diff options
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 12 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 2d9603d90..2fd146bf1 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -2285,7 +2285,11 @@ impl AstNode for PathPat { | |||
2285 | } | 2285 | } |
2286 | 2286 | ||
2287 | 2287 | ||
2288 | impl PathPat {} | 2288 | impl PathPat { |
2289 | pub fn path(&self) -> Option<&Path> { | ||
2290 | super::child_opt(self) | ||
2291 | } | ||
2292 | } | ||
2289 | 2293 | ||
2290 | // PathSegment | 2294 | // PathSegment |
2291 | #[derive(Debug, PartialEq, Eq, Hash)] | 2295 | #[derive(Debug, PartialEq, Eq, Hash)] |
@@ -3219,7 +3223,11 @@ impl AstNode for TuplePat { | |||
3219 | } | 3223 | } |
3220 | 3224 | ||
3221 | 3225 | ||
3222 | impl TuplePat {} | 3226 | impl TuplePat { |
3227 | pub fn args(&self) -> impl Iterator<Item = &Pat> { | ||
3228 | super::children(self) | ||
3229 | } | ||
3230 | } | ||
3223 | 3231 | ||
3224 | // TupleStructPat | 3232 | // TupleStructPat |
3225 | #[derive(Debug, PartialEq, Eq, Hash)] | 3233 | #[derive(Debug, PartialEq, Eq, Hash)] |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 2aaad46b1..b524c8aaf 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -490,14 +490,14 @@ Grammar( | |||
490 | "RefPat": ( options: [ "Pat" ]), | 490 | "RefPat": ( options: [ "Pat" ]), |
491 | "BindPat": ( traits: ["NameOwner"] ), | 491 | "BindPat": ( traits: ["NameOwner"] ), |
492 | "PlaceholderPat": (), | 492 | "PlaceholderPat": (), |
493 | "PathPat": (), | 493 | "PathPat": ( options: ["Path"] ), |
494 | "StructPat": (), | 494 | "StructPat": (), |
495 | "FieldPatList": (), | 495 | "FieldPatList": (), |
496 | "TupleStructPat": ( | 496 | "TupleStructPat": ( |
497 | options: ["Path"], | 497 | options: ["Path"], |
498 | collections: [["args", "Pat"]], | 498 | collections: [["args", "Pat"]], |
499 | ), | 499 | ), |
500 | "TuplePat": (), | 500 | "TuplePat": ( collections: [["args", "Pat"]] ), |
501 | "SlicePat": (), | 501 | "SlicePat": (), |
502 | "RangePat": (), | 502 | "RangePat": (), |
503 | 503 | ||