summaryrefslogtreecommitdiff
path: root/src/macro_rules
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2018-02-24 13:37:58 +0800
committerJohn Hodge <tpg@ucc.asn.au>2018-02-24 13:37:58 +0800
commit98ad2235464a00fab4287388ccd11b75a978d640 (patch)
tree1cb84650b235ed5fdf1a0893b1ff0b0d0a522350 /src/macro_rules
parent1b173dc2281022b42560f169a5f7445ba9528f6c (diff)
downloadmrust-98ad2235464a00fab4287388ccd11b75a978d640.tar.gz
macro_rules - Allow macros for :type
Diffstat (limited to 'src/macro_rules')
-rw-r--r--src/macro_rules/eval.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/macro_rules/eval.cpp b/src/macro_rules/eval.cpp
index 24adac3e..9372fa6e 100644
--- a/src/macro_rules/eval.cpp
+++ b/src/macro_rules/eval.cpp
@@ -1074,7 +1074,16 @@ namespace
case TOK_DOUBLE_COLON:
case TOK_INTERPOLATED_IDENT:
case TOK_INTERPOLATED_PATH:
- return consume_path(lex, true);
+ if( !consume_path(lex, true) )
+ return false;
+ if( lex.consume_if(TOK_EXCLAM) )
+ {
+ if( lex.next() != TOK_PAREN_OPEN && lex.next() != TOK_SQUARE_OPEN && lex.next() != TOK_BRACE_OPEN )
+ return false;
+ if( !consume_tt(lex) )
+ return false;
+ }
+ return true;
case TOK_AMP:
case TOK_DOUBLE_AMP:
lex.consume();