From a9bddf71aaca7fb6e00292b788479a465b867faf Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 13 Jul 2017 00:08:28 +0100 Subject: Add referencedSourceUnits() helper --- libsolidity/ast/AST.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libsolidity/ast/AST.cpp') diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 1e1e4839..c5fb35f6 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -84,6 +84,16 @@ SourceUnitAnnotation& SourceUnit::annotation() const return dynamic_cast(*m_annotation); } +vector SourceUnit::referencedSourceUnits() const +{ + vector sourceUnits; + for (ImportDirective const* importDirective: filteredNodes(nodes())) + { + sourceUnits.push_back(importDirective->annotation().sourceUnit); + } + return sourceUnits; +} + SourceUnit const& Declaration::sourceUnit() const { solAssert(!!m_scope, ""); -- cgit