|
|
@ -117,10 +117,18 @@ ASTPointer<ContractDefinition> Parser::parseContractDefinition() |
|
|
|
docstring = make_shared<ASTString>(m_scanner->getCurrentCommentLiteral()); |
|
|
|
expectToken(Token::CONTRACT); |
|
|
|
ASTPointer<ASTString> name = expectIdentifierToken(); |
|
|
|
expectToken(Token::LBRACE); |
|
|
|
vector<ASTPointer<Identifier>> baseContracts; |
|
|
|
vector<ASTPointer<StructDefinition>> structs; |
|
|
|
vector<ASTPointer<VariableDeclaration>> stateVariables; |
|
|
|
vector<ASTPointer<FunctionDefinition>> functions; |
|
|
|
if (m_scanner->getCurrentToken() == Token::IS) |
|
|
|
do |
|
|
|
{ |
|
|
|
m_scanner->next(); |
|
|
|
baseContracts.push_back(ASTNodeFactory(*this).createNode<Identifier>(expectIdentifierToken())); |
|
|
|
} |
|
|
|
while (m_scanner->getCurrentToken() == Token::COMMA); |
|
|
|
expectToken(Token::LBRACE); |
|
|
|
bool visibilityIsPublic = true; |
|
|
|
while (true) |
|
|
|
{ |
|
|
@ -149,7 +157,8 @@ ASTPointer<ContractDefinition> Parser::parseContractDefinition() |
|
|
|
} |
|
|
|
nodeFactory.markEndPosition(); |
|
|
|
expectToken(Token::RBRACE); |
|
|
|
return nodeFactory.createNode<ContractDefinition>(name, docstring, structs, stateVariables, functions); |
|
|
|
return nodeFactory.createNode<ContractDefinition>(name, docstring, baseContracts, structs, |
|
|
|
stateVariables, functions); |
|
|
|
} |
|
|
|
|
|
|
|
ASTPointer<FunctionDefinition> Parser::parseFunctionDefinition(bool _isPublic) |
|
|
|