aboutsummaryrefslogtreecommitdiffstats
path: root/Parser.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-22 02:07:03 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-29 04:46:16 +0800
commit9759eec2da1d75c70b8cd3eff3fe1bffade6854d (patch)
treec6f5cbbba224f6896283243eeda5b0034bf4bd50 /Parser.cpp
parent97c31b3e7d6a0bc4b024b15bc13d19b851b68ead (diff)
downloaddexon-solidity-9759eec2da1d75c70b8cd3eff3fe1bffade6854d.tar
dexon-solidity-9759eec2da1d75c70b8cd3eff3fe1bffade6854d.tar.gz
dexon-solidity-9759eec2da1d75c70b8cd3eff3fe1bffade6854d.tar.bz2
dexon-solidity-9759eec2da1d75c70b8cd3eff3fe1bffade6854d.tar.lz
dexon-solidity-9759eec2da1d75c70b8cd3eff3fe1bffade6854d.tar.xz
dexon-solidity-9759eec2da1d75c70b8cd3eff3fe1bffade6854d.tar.zst
dexon-solidity-9759eec2da1d75c70b8cd3eff3fe1bffade6854d.zip
Fix in addStateVariableAccessor and adjustment of parser tests
Diffstat (limited to 'Parser.cpp')
-rw-r--r--Parser.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Parser.cpp b/Parser.cpp
index cd395c77..c9ab551e 100644
--- a/Parser.cpp
+++ b/Parser.cpp
@@ -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)
)
);