aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-05-03 03:18:11 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-05-04 04:35:38 +0800
commit73c99d15cdf5ef0589096d6d42025a21502fc8d9 (patch)
tree8a771238a6d2700be5af121cbd361aa1888eeab5 /libsolidity
parent5738f93704a2d5de863d5f160adf8a27bf965361 (diff)
downloaddexon-solidity-73c99d15cdf5ef0589096d6d42025a21502fc8d9.tar
dexon-solidity-73c99d15cdf5ef0589096d6d42025a21502fc8d9.tar.gz
dexon-solidity-73c99d15cdf5ef0589096d6d42025a21502fc8d9.tar.bz2
dexon-solidity-73c99d15cdf5ef0589096d6d42025a21502fc8d9.tar.lz
dexon-solidity-73c99d15cdf5ef0589096d6d42025a21502fc8d9.tar.xz
dexon-solidity-73c99d15cdf5ef0589096d6d42025a21502fc8d9.tar.zst
dexon-solidity-73c99d15cdf5ef0589096d6d42025a21502fc8d9.zip
Remove useless helper expectAssignmentOperator in parser
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/parsing/Parser.cpp16
-rw-r--r--libsolidity/parsing/Parser.h1
2 files changed, 2 insertions, 15 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index a9ee9016..411466cd 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -1194,7 +1194,8 @@ ASTPointer<Expression> Parser::parseExpression(
ASTPointer<Expression> expression = parseBinaryExpression(4, _lookAheadIndexAccessStructure);
if (Token::isAssignmentOp(m_scanner->currentToken()))
{
- Token::Value assignmentOperator = expectAssignmentOperator();
+ Token::Value assignmentOperator = m_scanner->currentToken();
+ m_scanner->next();
ASTPointer<Expression> rightHandSide = parseExpression();
ASTNodeFactory nodeFactory(*this, expression);
nodeFactory.setEndPositionFromNode(rightHandSide);
@@ -1613,19 +1614,6 @@ string Parser::currentTokenName()
return Token::name(token);
}
-Token::Value Parser::expectAssignmentOperator()
-{
- Token::Value op = m_scanner->currentToken();
- if (!Token::isAssignmentOp(op))
- fatalParserError(
- string("Expected assignment operator, got '") +
- currentTokenName() +
- string("'")
- );
- m_scanner->next();
- return op;
-}
-
ASTPointer<ASTString> Parser::expectIdentifierToken()
{
Token::Value id = m_scanner->currentToken();
diff --git a/libsolidity/parsing/Parser.h b/libsolidity/parsing/Parser.h
index c4254231..2679af9f 100644
--- a/libsolidity/parsing/Parser.h
+++ b/libsolidity/parsing/Parser.h
@@ -166,7 +166,6 @@ private:
ASTPointer<Expression> expressionFromIndexAccessStructure(IndexAccessedPath const& _pathAndIndices);
std::string currentTokenName();
- Token::Value expectAssignmentOperator();
ASTPointer<ASTString> expectIdentifierToken();
ASTPointer<ASTString> getLiteralAndAdvance();
///@}