mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Some fixes in parser.
This commit is contained in:
+11
-4
@@ -167,7 +167,7 @@ ASTPointer<ContractDefinition> Parser::parseContractDefinition()
|
||||
ASTPointer<InheritanceSpecifier> Parser::parseInheritanceSpecifier()
|
||||
{
|
||||
ASTNodeFactory nodeFactory(*this);
|
||||
ASTPointer<Identifier> name = ASTNodeFactory(*this).createNode<Identifier>(expectIdentifierToken());
|
||||
ASTPointer<Identifier> name(parseIdentifier());
|
||||
vector<ASTPointer<Expression>> arguments;
|
||||
if (m_scanner->getCurrentToken() == Token::LPAREN)
|
||||
{
|
||||
@@ -283,7 +283,7 @@ ASTPointer<ModifierDefinition> Parser::parseModifierDefinition()
|
||||
ASTPointer<ModifierInvocation> Parser::parseModifierInvocation()
|
||||
{
|
||||
ASTNodeFactory nodeFactory(*this);
|
||||
ASTPointer<Identifier> name = ASTNodeFactory(*this).createNode<Identifier>(expectIdentifierToken());
|
||||
ASTPointer<Identifier> name(parseIdentifier());
|
||||
vector<ASTPointer<Expression>> arguments;
|
||||
if (m_scanner->getCurrentToken() == Token::LPAREN)
|
||||
{
|
||||
@@ -297,6 +297,13 @@ ASTPointer<ModifierInvocation> Parser::parseModifierInvocation()
|
||||
return nodeFactory.createNode<ModifierInvocation>(name, arguments);
|
||||
}
|
||||
|
||||
ASTPointer<Identifier> Parser::parseIdentifier()
|
||||
{
|
||||
ASTNodeFactory nodeFactory(*this);
|
||||
nodeFactory.markEndPosition();
|
||||
return nodeFactory.createNode<Identifier>(expectIdentifierToken());
|
||||
}
|
||||
|
||||
ASTPointer<TypeName> Parser::parseTypeName(bool _allowVar)
|
||||
{
|
||||
ASTPointer<TypeName> type;
|
||||
@@ -584,8 +591,8 @@ ASTPointer<Expression> Parser::parseLeftHandSideExpression()
|
||||
if (m_scanner->getCurrentToken() == Token::NEW)
|
||||
{
|
||||
expectToken(Token::NEW);
|
||||
ASTPointer<Identifier> contractName = ASTNodeFactory(*this).createNode<Identifier>(expectIdentifierToken());
|
||||
nodeFactory.markEndPosition();
|
||||
ASTPointer<Identifier> contractName(parseIdentifier());
|
||||
nodeFactory.setEndPositionFromNode(contractName);
|
||||
expression = nodeFactory.createNode<NewExpression>(contractName);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user