mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add AST Node IdentifierPath
This commit is contained in:
@@ -939,6 +939,14 @@ ASTPointer<Identifier> Parser::parseIdentifier()
|
||||
}
|
||||
|
||||
ASTPointer<UserDefinedTypeName> Parser::parseUserDefinedTypeName()
|
||||
{
|
||||
ASTNodeFactory nodeFactory(*this);
|
||||
ASTPointer<IdentifierPath> identifierPath = parseIdentifierPath();
|
||||
nodeFactory.setEndPositionFromNode(identifierPath);
|
||||
return nodeFactory.createNode<UserDefinedTypeName>(identifierPath);
|
||||
}
|
||||
|
||||
ASTPointer<IdentifierPath> Parser::parseIdentifierPath()
|
||||
{
|
||||
RecursionGuard recursionGuard(*this);
|
||||
ASTNodeFactory nodeFactory(*this);
|
||||
@@ -950,7 +958,7 @@ ASTPointer<UserDefinedTypeName> Parser::parseUserDefinedTypeName()
|
||||
nodeFactory.markEndPosition();
|
||||
identifierPath.push_back(*expectIdentifierToken());
|
||||
}
|
||||
return nodeFactory.createNode<UserDefinedTypeName>(identifierPath);
|
||||
return nodeFactory.createNode<IdentifierPath>(identifierPath);
|
||||
}
|
||||
|
||||
ASTPointer<TypeName> Parser::parseTypeNameSuffix(ASTPointer<TypeName> type, ASTNodeFactory& nodeFactory)
|
||||
@@ -2101,7 +2109,7 @@ ASTPointer<TypeName> Parser::typeNameFromIndexAccessStructure(Parser::IndexAcces
|
||||
vector<ASTString> path;
|
||||
for (auto const& el: _iap.path)
|
||||
path.push_back(dynamic_cast<Identifier const&>(*el).name());
|
||||
type = nodeFactory.createNode<UserDefinedTypeName>(path);
|
||||
type = nodeFactory.createNode<UserDefinedTypeName>(nodeFactory.createNode<IdentifierPath>(path));
|
||||
}
|
||||
for (auto const& lengthExpression: _iap.indices)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user