aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityExpressionCompiler.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-01-27 21:32:59 +0800
committerChristian <c@ethdev.com>2015-01-29 07:29:43 +0800
commitc3cc5b737a94df8e5f2ecce17a1ca26a744c538d (patch)
treea532f70e6ca226b863235eb92187eb5357ba0e32 /SolidityExpressionCompiler.cpp
parent4e67aa413e16a00c5056eb388bcf3bb011a7be57 (diff)
downloaddexon-solidity-c3cc5b737a94df8e5f2ecce17a1ca26a744c538d.tar.gz
dexon-solidity-c3cc5b737a94df8e5f2ecce17a1ca26a744c538d.tar.zst
dexon-solidity-c3cc5b737a94df8e5f2ecce17a1ca26a744c538d.zip
Super keyword.
Diffstat (limited to 'SolidityExpressionCompiler.cpp')
-rw-r--r--SolidityExpressionCompiler.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/SolidityExpressionCompiler.cpp b/SolidityExpressionCompiler.cpp
index 06c252db..a0cca3a3 100644
--- a/SolidityExpressionCompiler.cpp
+++ b/SolidityExpressionCompiler.cpp
@@ -86,7 +86,8 @@ Declaration const& resolveDeclaration(vector<string> const& _namespacedName,
}
bytes compileFirstExpression(const string& _sourceCode, vector<vector<string>> _functions = {},
- vector<vector<string>> _localVariables = {}, vector<shared_ptr<MagicVariableDeclaration const>> _globalDeclarations = {})
+ vector<vector<string>> _localVariables = {},
+ vector<shared_ptr<MagicVariableDeclaration const>> _globalDeclarations = {})
{
Parser parser;
ASTPointer<SourceUnit> sourceUnit;
@@ -99,10 +100,12 @@ bytes compileFirstExpression(const string& _sourceCode, vector<vector<string>> _
NameAndTypeResolver resolver(declarations);
resolver.registerDeclarations(*sourceUnit);
+ vector<ContractDefinition const*> inheritanceHierarchy;
for (ASTPointer<ASTNode> const& node: sourceUnit->getNodes())
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
{
BOOST_REQUIRE_NO_THROW(resolver.resolveNamesAndTypes(*contract));
+ inheritanceHierarchy = vector<ContractDefinition const*>(1, contract);
}
for (ASTPointer<ASTNode> const& node: sourceUnit->getNodes())
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
@@ -116,8 +119,7 @@ bytes compileFirstExpression(const string& _sourceCode, vector<vector<string>> _
BOOST_REQUIRE(extractor.getExpression() != nullptr);
CompilerContext context;
- for (vector<string> const& function: _functions)
- context.addFunction(dynamic_cast<FunctionDefinition const&>(resolveDeclaration(function, resolver)));
+ context.setInheritanceHierarchy(inheritanceHierarchy);
unsigned parametersSize = _localVariables.size(); // assume they are all one slot on the stack
context.adjustStackOffset(parametersSize);
for (vector<string> const& variable: _localVariables)