aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast/AST.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-12-15 22:46:03 +0800
committerchriseth <c@ethdev.com>2015-12-18 19:46:56 +0800
commit603dc58040e62ef99d0a10084340dd4548a438a8 (patch)
tree2c9246af514f8023117800bd8675703fc8d02fb4 /libsolidity/ast/AST.cpp
parentd3c459b5a99715c96733825f78d63cc57265ee3c (diff)
downloaddexon-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.cpp13
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();