mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix in addStateVariableAccessor and adjustment of parser tests
This commit is contained in:
parent
97c31b3e7d
commit
9759eec2da
@ -113,9 +113,10 @@ void Parser::addStateVariableAccessor(ASTPointer<VariableDeclaration> const& _va
|
||||
vector<ASTPointer<FunctionDefinition>> & _functions)
|
||||
{
|
||||
ASTNodeFactory nodeFactory(*this);
|
||||
nodeFactory.setLocationEmpty();
|
||||
ASTPointer<ASTString> emptyDoc;
|
||||
ASTPointer<ParameterList> emptyParamList;
|
||||
nodeFactory.markEndPosition();
|
||||
|
||||
vector<ASTPointer<VariableDeclaration>> parameters;
|
||||
auto expression = nodeFactory.createNode<Identifier>(make_shared<ASTString>(_varDecl->getName()));
|
||||
vector<ASTPointer<Statement>> block_statements = {nodeFactory.createNode<Return>(expression)};
|
||||
|
||||
@ -124,9 +125,9 @@ void Parser::addStateVariableAccessor(ASTPointer<VariableDeclaration> const& _va
|
||||
true, // isPublic
|
||||
false, // not a Constructor
|
||||
emptyDoc, // no documentation
|
||||
emptyParamList, // no parameters (temporary, a mapping would need parameters for example)
|
||||
nodeFactory.createNode<ParameterList>(vector<ASTPointer<VariableDeclaration>>()),
|
||||
true, // is constant
|
||||
emptyParamList, // no return parameters
|
||||
nodeFactory.createNode<ParameterList>(vector<ASTPointer<VariableDeclaration>>()),
|
||||
nodeFactory.createNode<Block>(block_statements)
|
||||
)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user