aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Token.h
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-09-07 00:59:50 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-09-11 20:52:23 +0800
commit1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f (patch)
tree258433cfc4c6fced543ba9cf968995e09438c851 /libsolidity/parsing/Token.h
parent7d5c13981623f5f931444d227b163d9b0d995fd8 (diff)
downloaddexon-solidity-1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f.tar.gz
dexon-solidity-1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f.tar.zst
dexon-solidity-1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f.zip
Accept ``address payable`` during parsing.
Diffstat (limited to 'libsolidity/parsing/Token.h')
-rw-r--r--libsolidity/parsing/Token.h7
1 files changed, 6 insertions, 1 deletions
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); }