aboutsummaryrefslogtreecommitdiffstats
path: root/Token.h
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2015-03-05 00:35:23 +0800
committerGav Wood <i@gavwood.com>2015-03-06 19:46:23 +0800
commit9aea119e54fbf2afa6d999e5419bb9db93eed2ce (patch)
tree6f4337f34e6a7e7fe0cf8572ac4d8e6c8ff5274f /Token.h
parent34e8de749aeecbca5f5dae817aa67f42907e9bf7 (diff)
downloaddexon-solidity-9aea119e54fbf2afa6d999e5419bb9db93eed2ce.tar
dexon-solidity-9aea119e54fbf2afa6d999e5419bb9db93eed2ce.tar.gz
dexon-solidity-9aea119e54fbf2afa6d999e5419bb9db93eed2ce.tar.bz2
dexon-solidity-9aea119e54fbf2afa6d999e5419bb9db93eed2ce.tar.lz
dexon-solidity-9aea119e54fbf2afa6d999e5419bb9db93eed2ce.tar.xz
dexon-solidity-9aea119e54fbf2afa6d999e5419bb9db93eed2ce.tar.zst
dexon-solidity-9aea119e54fbf2afa6d999e5419bb9db93eed2ce.zip
Add date/time language to solidity.
Diffstat (limited to 'Token.h')
-rw-r--r--Token.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/Token.h b/Token.h
index 19afaee3..85979b56 100644
--- a/Token.h
+++ b/Token.h
@@ -163,7 +163,7 @@ namespace solidity
K(New, "new", 0) \
K(Public, "public", 0) \
K(Private, "private", 0) \
- K(Internal, "internal", 0) \
+ K(Internal, "internal", 0) \
K(Return, "return", 0) \
K(Returns, "returns", 0) \
K(Struct, "struct", 0) \
@@ -172,11 +172,18 @@ namespace solidity
K(While, "while", 0) \
K(Enum, "enum", 0) \
\
- /* Ether subdenominations */ \
- K(SubWei, "wei", 0) \
- K(SubSzabo, "szabo", 0) \
- K(SubFinney, "finney", 0) \
- K(SubEther, "ether", 0) \
+ /* Ether subdenominations */ \
+ K(SubWei, "wei", 0) \
+ K(SubSzabo, "szabo", 0) \
+ K(SubFinney, "finney", 0) \
+ K(SubEther, "ether", 0) \
+ K(SubSecond, "seconds", 0) \
+ K(SubMinute, "minutes", 0) \
+ K(SubHour, "hours", 0) \
+ K(SubDay, "days", 0) \
+ K(SubWeek, "weeks", 0) \
+ K(SubYear, "years", 0) \
+ K(After, "after", 0) \
/* type keywords, keep them in this order, keep int as first keyword
* the implementation in Types.cpp has to be synced to this here */\
K(Int, "int", 0) \
@@ -377,12 +384,13 @@ public:
}
static bool isBitOp(Value op) { return (BitOr <= op && op <= SHR) || op == BitNot; }
- static bool isUnaryOp(Value op) { return (Not <= op && op <= Delete) || op == Add || op == Sub; }
+ static bool isUnaryOp(Value op) { return (Not <= op && op <= Delete) || op == Add || op == Sub || op == After; }
static bool isCountOp(Value op) { return op == Inc || op == Dec; }
static bool isShiftOp(Value op) { return (SHL <= op) && (op <= SHR); }
static bool isVisibilitySpecifier(Value op) { return isVariableVisibilitySpecifier(op) || op == External; }
static bool isVariableVisibilitySpecifier(Value op) { return op == Public || op == Private || op == Internal; }
- static bool isEtherSubdenomination(Value op) { return op == SubWei || op == SubSzabo || op == SubFinney || op == Token::SubEther; }
+ 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; }
// Returns a string corresponding to the JS token string
// (.e., "<" for the token LT) or NULL if the token doesn't