diff options
author | Christian <c@ethdev.com> | 2014-11-12 00:41:48 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-11-12 00:41:48 +0800 |
commit | 8c6bf21c01d3ae3c22301bbe0b039aa18e1f58a6 (patch) | |
tree | ba26de04d610fcc09c96f366a35bb148180a4e21 /AST.cpp | |
parent | a0c72065fee89c4558eeb4a98e5273633635bc39 (diff) | |
download | dexon-solidity-8c6bf21c01d3ae3c22301bbe0b039aa18e1f58a6.tar.gz dexon-solidity-8c6bf21c01d3ae3c22301bbe0b039aa18e1f58a6.tar.zst dexon-solidity-8c6bf21c01d3ae3c22301bbe0b039aa18e1f58a6.zip |
Provide interface for calls in JSON and some other formatting changes.
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -263,6 +263,21 @@ TypeError ASTNode::createTypeError(string const& _description) return TypeError() << errinfo_sourceLocation(getLocation()) << errinfo_comment(_description); } +vector<FunctionDefinition const*> ContractDefinition::getInterfaceFunctions() const +{ + vector<FunctionDefinition const*> exportedFunctions; + for (ASTPointer<FunctionDefinition> const& f: m_definedFunctions) + if (f->isPublic() && f->getName() != getName()) + exportedFunctions.push_back(f.get()); + auto compareNames = [](FunctionDefinition const* _a, FunctionDefinition const* _b) + { + return _a->getName().compare(_b->getName()) < 0; + }; + + sort(exportedFunctions.begin(), exportedFunctions.end(), compareNames); + return exportedFunctions; +} + void Block::checkTypeRequirements() { for (shared_ptr<Statement> const& statement: m_statements) |