aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast/AST.h
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-09 21:29:03 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-09 21:58:59 +0800
commitb210db8058851d19005f8ecd9d107a16e9c80e32 (patch)
tree53f553c8e4dc581ecba6e16bfee8862e8a775813 /libsolidity/ast/AST.h
parentefd45f64a542c722d750f79b483dd7428aba16ed (diff)
downloaddexon-solidity-b210db8058851d19005f8ecd9d107a16e9c80e32.tar.gz
dexon-solidity-b210db8058851d19005f8ecd9d107a16e9c80e32.tar.zst
dexon-solidity-b210db8058851d19005f8ecd9d107a16e9c80e32.zip
Make toString(visibility) a helper
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,