diff options
Diffstat (limited to 'src/macro_rules/parse.cpp')
-rw-r--r-- | src/macro_rules/parse.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/macro_rules/parse.cpp b/src/macro_rules/parse.cpp index b3b1014e..00cf7cf7 100644 --- a/src/macro_rules/parse.cpp +++ b/src/macro_rules/parse.cpp @@ -49,8 +49,7 @@ public: switch( GET_TOK(tok, lex) ) { // TODO: Allow any reserved word - case TOK_RWORD_TYPE: - case TOK_RWORD_PUB: + case TOK_RWORD_PUB ... TOK_RWORD_UNSIZED: case TOK_IDENT: { ::std::string name = tok.type() == TOK_IDENT ? mv$(tok.str()) : FMT(tok); GET_CHECK_TOK(tok, lex, TOK_COLON); @@ -200,10 +199,13 @@ public: default: throw ParseError::Unexpected(lex, tok); } - + } + else if( tok.type() == TOK_RWORD_CRATE ) + { + ret.push_back( MacroExpansionEnt( (1<<30) | 0 ) ); } //else if( tok.type() == TOK_IDENT || tok_is_rword(tok.type()) ) - else if( tok.type() == TOK_IDENT || tok.type() == TOK_RWORD_TYPE || tok.type() == TOK_RWORD_PUB ) + else if( tok.type() == TOK_IDENT || tok.type() >= TOK_RWORD_PUB ) { // Look up the named parameter in the list of param names for this arm auto name = tok.type() == TOK_IDENT ? tok.str() : FMT(tok); @@ -222,10 +224,6 @@ public: } ret.push_back( MacroExpansionEnt(idx) ); } - else if( tok.type() == TOK_RWORD_CRATE ) - { - ret.push_back( MacroExpansionEnt( (1<<30) | 0 ) ); - } else { throw ParseError::Unexpected(lex, tok); |