aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorMarcus Klaas de Vries <[email protected]>2019-01-15 14:24:04 +0000
committerAleksey Kladov <[email protected]>2019-01-19 12:37:25 +0000
commitafaa26636e4391ebacfc09e9c994c11bab58b834 (patch)
tree79d66f1d2eb70f3092285ab37f1e21c3832ea8b8 /crates/ra_syntax/src
parent0a82d9cdc975da27e78839e1a8cb873ba99ae64b (diff)
Add additional pattern variants
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/ast/generated.rs12
-rw-r--r--crates/ra_syntax/src/grammar.ron4
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
2288impl PathPat {} 2288impl 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
3222impl TuplePat {} 3226impl 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