summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-11-26 11:27:18 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-11-26 11:27:18 +0800
commitae9b8fb6a738d0f8be49c63d846ca713eaa2eab1 (patch)
tree333acaf0abb53f58fa5c76ebf1f047dae55c9ba6 /src
parent83beaea9602af2c2cf0ddd690a74ebb8d09762b8 (diff)
downloadmrust-ae9b8fb6a738d0f8be49c63d846ca713eaa2eab1.tar.gz
macro_rules - Fix parsing of loop labels
Diffstat (limited to 'src')
-rw-r--r--src/macro_rules/eval.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/macro_rules/eval.cpp b/src/macro_rules/eval.cpp
index 6344b26a..fc54616e 100644
--- a/src/macro_rules/eval.cpp
+++ b/src/macro_rules/eval.cpp
@@ -1116,6 +1116,9 @@ namespace
return consume_tt(lex);
}
break;
+ case TOK_RWORD_BOX:
+ lex.consume();
+ return consume_pat(lex);
case TOK_AMP:
case TOK_DOUBLE_AMP:
lex.consume();
@@ -1202,6 +1205,7 @@ namespace
case TOK_STAR: // Deref
case TOK_DASH: // Negate
case TOK_EXCLAM: // Invert
+ case TOK_RWORD_BOX: // Box
lex.consume();
break;
case TOK_AMP:
@@ -1222,9 +1226,12 @@ namespace
switch(lex.next())
{
case TOK_RWORD_CONTINUE:
- case TOK_RWORD_RETURN:
case TOK_RWORD_BREAK:
lex.consume();
+ lex.consume_if(TOK_LIFETIME);
+ if(0)
+ case TOK_RWORD_RETURN:
+ lex.consume();
switch(lex.next())
{
case TOK_EOF: