aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar.ron
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-15 08:10:16 +0100
committerGitHub <[email protected]>2019-09-15 08:10:16 +0100
commit2d79a1ad83cc39075c7c9e3230973013c8c58b17 (patch)
treee394007f715f8586c737db8f20f2d8f16f8913af /crates/ra_syntax/src/grammar.ron
parentbcdba777bdc43762cff73ac3ded4ae737a503692 (diff)
parent0956323bb7b728da6bff4ad7241a542f4bb4e8e6 (diff)
Merge #1848
1848: Parse `..` as a full pattern r=matklad a=ecstatic-morse Resolves #1479. This PR implements [RFC 2707](https://github.com/rust-lang/rfcs/pull/2707) in the parser. It introduces a new `DotDotPat` AST node modeled on `PlaceholderPat` and changes the parsing of tuple and slice patterns to conform to the RFC. Notably, this PR does *not* change the resulting AST when `..` appears in a struct pattern (e.g. `Struct { a, b: c, .. }`). I *think* this is the behavior mandated by RFC 2707, but someone should confirm this. Co-authored-by: Dylan MacKenzie <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/grammar.ron')
-rw-r--r--crates/ra_syntax/src/grammar.ron3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron
index 8f064711d..08cc6eeea 100644
--- a/crates/ra_syntax/src/grammar.ron
+++ b/crates/ra_syntax/src/grammar.ron
@@ -161,6 +161,7 @@ Grammar(
161 "BOX_PAT", 161 "BOX_PAT",
162 "BIND_PAT", 162 "BIND_PAT",
163 "PLACEHOLDER_PAT", 163 "PLACEHOLDER_PAT",
164 "DOT_DOT_PAT",
164 "PATH_PAT", 165 "PATH_PAT",
165 "RECORD_PAT", 166 "RECORD_PAT",
166 "RECORD_FIELD_PAT_LIST", 167 "RECORD_FIELD_PAT_LIST",
@@ -532,6 +533,7 @@ Grammar(
532 traits: ["NameOwner"] 533 traits: ["NameOwner"]
533 ), 534 ),
534 "PlaceholderPat": (), 535 "PlaceholderPat": (),
536 "DotDotPat": (),
535 "PathPat": ( options: [ "Path" ] ), 537 "PathPat": ( options: [ "Path" ] ),
536 "RecordPat": ( options: ["RecordFieldPatList", "Path"] ), 538 "RecordPat": ( options: ["RecordFieldPatList", "Path"] ),
537 "RecordFieldPatList": ( 539 "RecordFieldPatList": (
@@ -559,6 +561,7 @@ Grammar(
559 "BoxPat", 561 "BoxPat",
560 "BindPat", 562 "BindPat",
561 "PlaceholderPat", 563 "PlaceholderPat",
564 "DotDotPat",
562 "PathPat", 565 "PathPat",
563 "RecordPat", 566 "RecordPat",
564 "TupleStructPat", 567 "TupleStructPat",