diff options
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(); |