summaryrefslogtreecommitdiff
path: root/src/macro_rules
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2019-10-26 16:09:24 +0800
committerJohn Hodge <tpg@mutabah.net>2019-10-26 16:09:24 +0800
commit9ce35b65e5be4ce75b3b7aabe29c432128a17279 (patch)
tree069581e21b424a24c92b1f87e7d00f3af006366d /src/macro_rules
parentabd2a151b9107221e753c5b2fe09a143d09ad1f5 (diff)
downloadmrust-9ce35b65e5be4ce75b3b7aabe29c432128a17279.tar.gz
All - Compilation fixes on VS2015 (constructors, warnings, missing files, class/struct disagreement, <algorithm>)
Diffstat (limited to 'src/macro_rules')
-rw-r--r--src/macro_rules/parse.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/macro_rules/parse.cpp b/src/macro_rules/parse.cpp
index 97e1f8f9..43ffb097 100644
--- a/src/macro_rules/parse.cpp
+++ b/src/macro_rules/parse.cpp
@@ -58,7 +58,9 @@ public:
switch( GET_TOK(tok, lex) )
{
// TODO: Allow any reserved word
- case TOK_RWORD_PUB ... TOK_RWORD_UNSIZED:
+ default:
+ if( !(TOK_RWORD_PUB <= tok.type() && tok.type() <= TOK_RWORD_UNSIZED) )
+ throw ParseError::Unexpected(lex, tok);
case TOK_IDENT: {
auto name = tok.type() == TOK_IDENT ? tok.istr() : RcString::new_interned(FMT(tok));
GET_CHECK_TOK(tok, lex, TOK_COLON);
@@ -123,8 +125,6 @@ public:
throw ParseError::Unexpected(lex, tok);
}
break; }
- default:
- throw ParseError::Unexpected(lex, tok);
}
break;
case TOK_EOF: