aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/ParserBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/parsing/ParserBase.cpp')
-rw-r--r--libsolidity/parsing/ParserBase.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/libsolidity/parsing/ParserBase.cpp b/libsolidity/parsing/ParserBase.cpp
index 71085a4d..2abf58cc 100644
--- a/libsolidity/parsing/ParserBase.cpp
+++ b/libsolidity/parsing/ParserBase.cpp
@@ -47,7 +47,17 @@ void ParserBase::expectToken(Token::Value _value)
Token::Value tok = m_scanner->currentToken();
if (tok != _value)
{
- if (Token::isElementaryTypeName(tok)) //for the sake of accuracy in reporting
+ if (Token::isReservedKeyword(tok))
+ {
+ fatalParserError(
+ string("Expected token ") +
+ string(Token::name(_value)) +
+ string(" got reserved keyword '") +
+ string(Token::name(tok)) +
+ string("'")
+ );
+ }
+ else if (Token::isElementaryTypeName(tok)) //for the sake of accuracy in reporting
{
ElementaryTypeNameToken elemTypeName = m_scanner->currentElementaryTypeNameToken();
fatalParserError(