diff options
author | chriseth <c@ethdev.com> | 2016-11-14 18:46:43 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-12-01 23:03:59 +0800 |
commit | 5789eaa78d0e00f6289101e02f7de5e9decdc7e5 (patch) | |
tree | 8964f493235d310baa50806fdff65138054d2439 /libsolidity/ast/AST.cpp | |
parent | 55a719a79c1ab5b78ea6e1bcb4f27a888494a538 (diff) | |
download | dexon-solidity-5789eaa78d0e00f6289101e02f7de5e9decdc7e5.tar.gz dexon-solidity-5789eaa78d0e00f6289101e02f7de5e9decdc7e5.tar.zst dexon-solidity-5789eaa78d0e00f6289101e02f7de5e9decdc7e5.zip |
Metadata stamp.
Diffstat (limited to 'libsolidity/ast/AST.cpp')
-rw-r--r-- | libsolidity/ast/AST.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 9b478393..f8eb7108 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -63,6 +63,14 @@ SourceUnitAnnotation& SourceUnit::annotation() const return static_cast<SourceUnitAnnotation&>(*m_annotation); } +string Declaration::sourceUnitName() const +{ + ASTNode const* scope = m_scope; + while (dynamic_cast<Declaration const*>(scope) && dynamic_cast<Declaration const*>(scope)->m_scope) + scope = dynamic_cast<Declaration const*>(scope)->m_scope; + return dynamic_cast<SourceUnit const&>(*scope).annotation().path; +} + ImportAnnotation& ImportDirective::annotation() const { if (!m_annotation) |