diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-15 08:10:16 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-15 08:10:16 +0100 |
commit | 2d79a1ad83cc39075c7c9e3230973013c8c58b17 (patch) | |
tree | e394007f715f8586c737db8f20f2d8f16f8913af /crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt | |
parent | bcdba777bdc43762cff73ac3ded4ae737a503692 (diff) | |
parent | 0956323bb7b728da6bff4ad7241a542f4bb4e8e6 (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/test_data/parser/inline/ok/0024_slice_pat.txt')
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt index c1d669e54..48aaeaf07 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt | |||
@@ -27,7 +27,8 @@ SOURCE_FILE@[0; 39) | |||
27 | IDENT@[24; 25) "b" | 27 | IDENT@[24; 25) "b" |
28 | COMMA@[25; 26) "," | 28 | COMMA@[25; 26) "," |
29 | WHITESPACE@[26; 27) " " | 29 | WHITESPACE@[26; 27) " " |
30 | DOTDOT@[27; 29) ".." | 30 | DOT_DOT_PAT@[27; 29) |
31 | DOTDOT@[27; 29) ".." | ||
31 | R_BRACK@[29; 30) "]" | 32 | R_BRACK@[29; 30) "]" |
32 | WHITESPACE@[30; 31) " " | 33 | WHITESPACE@[30; 31) " " |
33 | EQ@[31; 32) "=" | 34 | EQ@[31; 32) "=" |