summaryrefslogtreecommitdiff
path: root/src/parse/pattern.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-07-29 12:47:44 +0100
committerJohn Hodge <tpg@mutabah.net>2018-07-29 12:47:44 +0100
commitc971a6fa8375598ecf9c99ee6b086e8cf957f568 (patch)
treef7f431cbac52e6b25d311bedd503b6584c51bd37 /src/parse/pattern.cpp
parent5d4bf9e96d795623f1b32b2f1f2e57c4f74419fe (diff)
downloadmrust-c971a6fa8375598ecf9c99ee6b086e8cf957f568.tar.gz
All - Initial work on supporting 1.29 as a target version
Diffstat (limited to 'src/parse/pattern.cpp')
-rw-r--r--src/parse/pattern.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parse/pattern.cpp b/src/parse/pattern.cpp
index f6d61728..239bac80 100644
--- a/src/parse/pattern.cpp
+++ b/src/parse/pattern.cpp
@@ -113,6 +113,7 @@ AST::Pattern Parse_Pattern(TokenStream& lex, bool is_refutable)
break;
// Known value `IDENT ...`
case TOK_TRIPLE_DOT:
+ case TOK_DOUBLE_DOT_EQUAL:
break;
// Known binding `ident @`
case TOK_AT:
@@ -156,7 +157,9 @@ AST::Pattern Parse_PatternReal(TokenStream& lex, bool is_refutable)
}
auto ps = lex.start_span();
AST::Pattern ret = Parse_PatternReal1(lex, is_refutable);
- if( GET_TOK(tok, lex) == TOK_TRIPLE_DOT )
+ if( (GET_TOK(tok, lex) == TOK_TRIPLE_DOT)
+ || (TARGETVER_1_29 && tok.type() == TOK_DOUBLE_DOT_EQUAL)
+ )
{
if( !ret.data().is_Value() )
throw ParseError::Generic(lex, "Using '...' with a non-value on left");