diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-09 21:29:03 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-09 21:58:59 +0800 |
commit | b210db8058851d19005f8ecd9d107a16e9c80e32 (patch) | |
tree | 53f553c8e4dc581ecba6e16bfee8862e8a775813 /libsolidity/parsing/Parser.cpp | |
parent | efd45f64a542c722d750f79b483dd7428aba16ed (diff) | |
download | dexon-solidity-b210db8058851d19005f8ecd9d107a16e9c80e32.tar.gz dexon-solidity-b210db8058851d19005f8ecd9d107a16e9c80e32.tar.zst dexon-solidity-b210db8058851d19005f8ecd9d107a16e9c80e32.zip |
Make toString(visibility) a helper
Diffstat (limited to 'libsolidity/parsing/Parser.cpp')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 7e1d36dd..a6d6e025 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -307,24 +307,6 @@ Declaration::Visibility Parser::parseVisibilitySpecifier(Token::Value _token) return visibility; } -string Parser::visibilitySpecifierName(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 string(); -} - Parser::FunctionHeaderParserResult Parser::parseFunctionHeader(bool _forceEmptyName, bool _allowModifiers) { FunctionHeaderParserResult result; @@ -374,7 +356,7 @@ Parser::FunctionHeaderParserResult Parser::parseFunctionHeader(bool _forceEmptyN { parserError(string( "Visibility already specified as \"" + - visibilitySpecifierName(result.visibility) + + Declaration::visibilityToString(result.visibility) + "\"." )); m_scanner->next(); @@ -536,7 +518,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration( { parserError(string( "Visibility already specified as \"" + - visibilitySpecifierName(visibility) + + Declaration::visibilityToString(visibility) + "\"." )); m_scanner->next(); |