aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast/AST.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/ast/AST.h')
-rw-r--r--libsolidity/ast/AST.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h
index 3e97286b..bdf20e81 100644
--- a/libsolidity/ast/AST.h
+++ b/libsolidity/ast/AST.h
@@ -152,6 +152,24 @@ public:
/// Visibility ordered from restricted to unrestricted.
enum class Visibility { Default, Private, Internal, Public, External };
+ static std::string visibilityToString(Declaration::Visibility _visibility)
+ {
+ switch(_visibility)
+ {
+ case Declaration::Visibility::Public:
+ return "public";
+ case Declaration::Visibility::Internal:
+ return "internal";
+ case Declaration::Visibility::Private:
+ return "private";
+ case Declaration::Visibility::External:
+ return "external";
+ default:
+ solAssert(false, "Invalid visibility specifier.");
+ }
+ return std::string();
+ }
+
Declaration(
SourceLocation const& _location,
ASTPointer<ASTString> const& _name,