diff options
| author | defuz <defuz.net@gmail.com> | 2015-01-22 21:56:27 +0200 |
|---|---|---|
| committer | defuz <defuz.net@gmail.com> | 2015-02-28 10:56:46 +0200 |
| commit | 52fa187431b4209a4e8606790287eaf08741ef25 (patch) | |
| tree | 2a86723302629206bf9eb23115f70b2d243a13ec /src/libsyntax | |
| parent | 48aeaba9347a25b2e3848e0dcbc1d8f6b0076718 (diff) | |
| download | rust-52fa187431b4209a4e8606790287eaf08741ef25.tar.gz rust-52fa187431b4209a4e8606790287eaf08741ef25.zip | |
FIX #21475: Interval match patterns won't parse namespace specifiers correctly
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f171e8279f4..1ef62cdf315 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3539,6 +3539,19 @@ impl<'a> Parser<'a> { self.bump(); pat = PatStruct(enum_path, fields, etc); } + token::DotDotDot => { + let hi = self.last_span.hi; + let start = self.mk_expr(lo, hi, ExprPath(enum_path)); + self.eat(&token::DotDotDot); + let end = if self.token.is_ident() || self.token.is_path() { + let path = self.parse_path(LifetimeAndTypesWithColons); + let hi = self.span.hi; + self.mk_expr(lo, hi, ExprPath(path)) + } else { + self.parse_literal_maybe_minus() + }; + pat = PatRange(start, end); + } _ => { let mut args: Vec<P<Pat>> = Vec::new(); match self.token { |
