diff options
author | chriseth <chris@ethereum.org> | 2018-02-14 08:48:40 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-02-27 19:17:25 +0800 |
commit | 6b9dda06f3d85344a70efb2f868760a0dde9dc45 (patch) | |
tree | 860f6e2c040387261969907fc1214b6aa9bc234d /libsolidity/ast/AST.cpp | |
parent | e227bdbfa7157d2675c177c75d44e13f0bd82214 (diff) | |
download | dexon-solidity-6b9dda06f3d85344a70efb2f868760a0dde9dc45.tar.gz dexon-solidity-6b9dda06f3d85344a70efb2f868760a0dde9dc45.tar.zst dexon-solidity-6b9dda06f3d85344a70efb2f868760a0dde9dc45.zip |
Enable C99-scoping with the 0.5.0-experimental pragma.
Diffstat (limited to 'libsolidity/ast/AST.cpp')
-rw-r--r-- | libsolidity/ast/AST.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 60a15aeb..27220b1f 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -96,21 +96,6 @@ set<SourceUnit const*> SourceUnit::referencedSourceUnits(bool _recurse, set<Sour return sourceUnits; } -SourceUnit const& Declaration::sourceUnit() const -{ - ASTNode const* s = scope(); - solAssert(s, ""); - // will not always be a declaratoion - while (dynamic_cast<Scopable const*>(s) && dynamic_cast<Scopable const*>(s)->scope()) - s = dynamic_cast<Scopable const*>(s)->scope(); - return dynamic_cast<SourceUnit const&>(*s); -} - -string Declaration::sourceUnitName() const -{ - return sourceUnit().annotation().path; -} - ImportAnnotation& ImportDirective::annotation() const { if (!m_annotation) @@ -409,6 +394,21 @@ UserDefinedTypeNameAnnotation& UserDefinedTypeName::annotation() const return dynamic_cast<UserDefinedTypeNameAnnotation&>(*m_annotation); } +SourceUnit const& Scopable::sourceUnit() const +{ + ASTNode const* s = scope(); + solAssert(s, ""); + // will not always be a declaratoion + while (dynamic_cast<Scopable const*>(s) && dynamic_cast<Scopable const*>(s)->scope()) + s = dynamic_cast<Scopable const*>(s)->scope(); + return dynamic_cast<SourceUnit const&>(*s); +} + +string Scopable::sourceUnitName() const +{ + return sourceUnit().annotation().path; +} + bool VariableDeclaration::isLValue() const { // External function parameters and constant declared variables are Read-Only |