aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/parsing/Parser.cpp')
-rw-r--r--libsolidity/parsing/Parser.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index 411466cd..37732a37 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -1602,27 +1602,10 @@ ASTPointer<ParameterList> Parser::createEmptyParameterList()
return nodeFactory.createNode<ParameterList>(vector<ASTPointer<VariableDeclaration>>());
}
-string Parser::currentTokenName()
-{
- Token::Value token = m_scanner->currentToken();
- if (Token::isElementaryTypeName(token)) //for the sake of accuracy in reporting
- {
- ElementaryTypeNameToken elemTypeName = m_scanner->currentElementaryTypeNameToken();
- return elemTypeName.toString();
- }
- else
- return Token::name(token);
-}
-
ASTPointer<ASTString> Parser::expectIdentifierToken()
{
- Token::Value id = m_scanner->currentToken();
- if (id != Token::Identifier)
- fatalParserError(
- string("Expected identifier, got '") +
- currentTokenName() +
- string("'")
- );
+ // do not advance on success
+ expectToken(Token::Identifier, false);
return getLiteralAndAdvance();
}