From 1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 6 Sep 2018 18:59:50 +0200 Subject: Accept ``address payable`` during parsing. --- libsolidity/parsing/Token.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libsolidity/parsing/Token.h') diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index 7ce24e69..73c85482 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -312,7 +312,12 @@ public: static bool isVisibilitySpecifier(Value op) { return isVariableVisibilitySpecifier(op) || op == External; } static bool isVariableVisibilitySpecifier(Value op) { return op == Public || op == Private || op == Internal; } static bool isLocationSpecifier(Value op) { return op == Memory || op == Storage || op == CallData; } - static bool isStateMutabilitySpecifier(Value op) { return op == Pure || op == Constant || op == View || op == Payable; } + static bool isStateMutabilitySpecifier(Value op, bool _allowConstant = true) + { + if (op == Constant && _allowConstant) + return true; + return op == Pure || op == View || op == Payable; + } static bool isEtherSubdenomination(Value op) { return op == SubWei || op == SubSzabo || op == SubFinney || op == SubEther; } static bool isTimeSubdenomination(Value op) { return op == SubSecond || op == SubMinute || op == SubHour || op == SubDay || op == SubWeek || op == SubYear; } static bool isReservedKeyword(Value op) { return (Abstract <= op && op <= Unchecked); } -- cgit v1.2.3