diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-22 10:10:21 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-22 16:00:27 +0800 |
commit | ba518943ce1ee8cbdbb31aa803142393a74af0ba (patch) | |
tree | aadcc1732b3a282a14b6d65d4e961f713278f954 /src | |
parent | 277d72e62b0e96e6a49abfc925c87b1073bf5d54 (diff) | |
download | mrust-ba518943ce1ee8cbdbb31aa803142393a74af0ba.tar.gz |
Parse - Fix deficiency in parsing lifetime bounds
Diffstat (limited to 'src')
-rw-r--r-- | src/parse/root.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/parse/root.cpp b/src/parse/root.cpp index dbb079d7..4af5c147 100644 --- a/src/parse/root.cpp +++ b/src/parse/root.cpp @@ -178,9 +178,12 @@ void Parse_WhereClause(TokenStream& lex, AST::GenericParams& params) {
auto lhs = mv$(tok.str());
GET_CHECK_TOK(tok, lex, TOK_COLON);
- GET_CHECK_TOK(tok, lex, TOK_LIFETIME);
- auto rhs = mv$(tok.str());
- params.add_bound( AST::GenericBound::make_Lifetime({lhs, rhs}) );
+ do {
+ GET_CHECK_TOK(tok, lex, TOK_LIFETIME);
+ auto rhs = mv$(tok.str());
+ params.add_bound( AST::GenericBound::make_Lifetime({lhs, rhs}) );
+ } while( GET_TOK(tok, lex) == TOK_PLUS );
+ PUTBACK(tok, lex);
}
// Higher-ranked types/lifetimes
else if( tok.type() == TOK_RWORD_FOR )
|