diff options
author | John Hodge <tpg@ucc.asn.au> | 2018-02-24 13:37:58 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2018-02-24 13:37:58 +0800 |
commit | 98ad2235464a00fab4287388ccd11b75a978d640 (patch) | |
tree | 1cb84650b235ed5fdf1a0893b1ff0b0d0a522350 /src/macro_rules | |
parent | 1b173dc2281022b42560f169a5f7445ba9528f6c (diff) | |
download | mrust-98ad2235464a00fab4287388ccd11b75a978d640.tar.gz |
macro_rules - Allow macros for :type
Diffstat (limited to 'src/macro_rules')
-rw-r--r-- | src/macro_rules/eval.cpp | 11 |
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(); |