From b210db8058851d19005f8ecd9d107a16e9c80e32 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 9 Aug 2017 14:29:03 +0100 Subject: Make toString(visibility) a helper --- libsolidity/ast/AST.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libsolidity/ast/AST.h') 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 const& _name, -- cgit