diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-07 00:42:38 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-07 00:42:38 +0800 |
commit | 5e875ee072134f867203c920d723f08b08ec67ab (patch) | |
tree | ce5530aecabffc652b02f80851c1bfe5a9b2d797 /AST.cpp | |
parent | ca733fd31900691bf58522f49811ceb0a00f9042 (diff) | |
download | dexon-solidity-5e875ee072134f867203c920d723f08b08ec67ab.tar.gz dexon-solidity-5e875ee072134f867203c920d723f08b08ec67ab.tar.zst dexon-solidity-5e875ee072134f867203c920d723f08b08ec67ab.zip |
Creating the canonical signature of a function, for later use in the ABI
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -110,6 +110,23 @@ void FunctionDefinition::checkTypeRequirements() m_body->checkTypeRequirements(); } +std::string FunctionDefinition::getCanonicalSignature() +{ + auto parameters = getParameters(); + std::string ret = getName() + "("; + unsigned int i = 1; + + for (ASTPointer<VariableDeclaration> const& member: parameters) + { + ret += member->getType()->toString(); + if (i != parameters.size()) { + ret += ","; + } + } + ret += ")"; + return ret; +} + void Block::checkTypeRequirements() { for (shared_ptr<Statement> const& statement: m_statements) |