diff options
author | chriseth <c@ethdev.com> | 2015-12-15 22:46:03 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-12-18 19:46:56 +0800 |
commit | 603dc58040e62ef99d0a10084340dd4548a438a8 (patch) | |
tree | 2c9246af514f8023117800bd8675703fc8d02fb4 /libsolidity/ast/AST.cpp | |
parent | d3c459b5a99715c96733825f78d63cc57265ee3c (diff) | |
download | dexon-solidity-603dc58040e62ef99d0a10084340dd4548a438a8.tar.gz dexon-solidity-603dc58040e62ef99d0a10084340dd4548a438a8.tar.zst dexon-solidity-603dc58040e62ef99d0a10084340dd4548a438a8.zip |
Simple aliasing during import.
Diffstat (limited to 'libsolidity/ast/AST.cpp')
-rw-r--r-- | libsolidity/ast/AST.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 701202f9..b5affa8e 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -56,6 +56,13 @@ Error ASTNode::createTypeError(string const& _description) const return Error(Error::Type::TypeError) << errinfo_sourceLocation(location()) << errinfo_comment(_description); } +SourceUnitAnnotation& SourceUnit::annotation() const +{ + if (!m_annotation) + m_annotation = new SourceUnitAnnotation(); + return static_cast<SourceUnitAnnotation&>(*m_annotation); +} + ImportAnnotation& ImportDirective::annotation() const { if (!m_annotation) @@ -63,6 +70,12 @@ ImportAnnotation& ImportDirective::annotation() const return static_cast<ImportAnnotation&>(*m_annotation); } +TypePointer ImportDirective::type() const +{ + solAssert(!!annotation().sourceUnit, ""); + return make_shared<ModuleType>(*annotation().sourceUnit); +} + map<FixedHash<4>, FunctionTypePointer> ContractDefinition::interfaceFunctions() const { auto exportedFunctionList = interfaceFunctionList(); |