diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-09-10 21:35:01 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-09-10 21:35:01 +0800 |
commit | ba896adbdbec1384f0617bb2c8c8f079005a40bb (patch) | |
tree | 516b670f011452c674ceaf0c309955ee57d416a9 /src | |
parent | 9c31f71380cee5d7e6a67d2f7f805619366e2e64 (diff) | |
download | mrust-ba896adbdbec1384f0617bb2c8c8f079005a40bb.tar.gz |
macro_rules - Fix some holes in consume_*
Diffstat (limited to 'src')
-rw-r--r-- | src/macro_rules/eval.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/macro_rules/eval.cpp b/src/macro_rules/eval.cpp index 62c6ccaf..61a190ab 100644 --- a/src/macro_rules/eval.cpp +++ b/src/macro_rules/eval.cpp @@ -1098,6 +1098,8 @@ namespace for(;;) { + if( lex.consume_if(TOK_UNDERSCORE) ) + return true; switch(lex.next()) { case TOK_IDENT: @@ -1106,6 +1108,9 @@ namespace case TOK_DOUBLE_COLON: case TOK_INTERPOLATED_PATH: consume_path(lex); + if( lex.next() == TOK_BRACE_OPEN ) { + return consume_tt(lex); + } break; case TOK_AMP: case TOK_DOUBLE_AMP: @@ -1154,8 +1159,10 @@ namespace TRACE_FUNCTION; bool cont; - if( lex.next() == TOK_PIPE || lex.next() == TOK_DOUBLE_PIPE ) + // Closures + if( lex.next() == TOK_RWORD_MOVE || lex.next() == TOK_PIPE || lex.next() == TOK_DOUBLE_PIPE ) { + lex.consume_if(TOK_RWORD_MOVE); if( lex.consume_if(TOK_PIPE) ) { do |