aboutsummaryrefslogtreecommitdiffstats
path: root/liblangutil/Token.h
diff options
context:
space:
mode:
authorLazaridis <info@lazaridis.com>2018-11-23 00:37:19 +0800
committerChristian Parpart <christian@ethereum.org>2018-11-24 00:27:52 +0800
commite454737a3cf389ee400a9ef1d9f252c579a2ceea (patch)
treed122730a73f18b827071dd80c797926f70a1a50a /liblangutil/Token.h
parent2e861bf1a0825d17386655cdaaa2c7371b6d2c5c (diff)
downloaddexon-solidity-e454737a3cf389ee400a9ef1d9f252c579a2ceea.tar.gz
dexon-solidity-e454737a3cf389ee400a9ef1d9f252c579a2ceea.tar.zst
dexon-solidity-e454737a3cf389ee400a9ef1d9f252c579a2ceea.zip
adapt to latest code changes
Diffstat (limited to 'liblangutil/Token.h')
-rw-r--r--liblangutil/Token.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/liblangutil/Token.h b/liblangutil/Token.h
index d997b138..55d474f5 100644
--- a/liblangutil/Token.h
+++ b/liblangutil/Token.h
@@ -265,6 +265,15 @@ namespace langutil
T(Illegal, "ILLEGAL", 0) \
/* Illegal hex token */ \
T(IllegalHex, "ILLEGAL_HEX", 0) \
+ T(IllegalCommentTerminator, "ILLEGAL_COMMENT_TERMINATOR", 0) \
+ T(IllegalStringEscape, "ILLEGAL_STRING_ESCAPE", 0) \
+ T(IllegalStringEndQuote, "ILLEGAL_STRING_END_QUOTE", 0) \
+ T(IllegalNumberSeparator, "ILLEGAL_NUMER_SEPARATOR", 0) \
+ T(IllegalHexDigit, "ILLEGAL_HEX_DIGIT", 0) \
+ T(IllegalOctalNotAllowed, "ILLEGAL_OCTAL_NOT_ALLOWED", 0) \
+ T(IllegalExponent, "ILLEGAL_EXPONENT", 0) \
+ T(IllegalNumberEnd, "ILLEGAL_NUMBER_END", 0) \
+ T(IllegalEnd, NULL, 0) /* used as type Illegal enum end marker */ \
\
/* Scanner-internal use only. */ \
T(Whitespace, nullptr, 0)
@@ -312,6 +321,9 @@ namespace TokenTraits
constexpr bool isTimeSubdenomination(Token op) { return op == Token::SubSecond || op == Token::SubMinute || op == Token::SubHour || op == Token::SubDay || op == Token::SubWeek || op == Token::SubYear; }
constexpr bool isReservedKeyword(Token op) { return (Token::Abstract <= op && op <= Token::Unchecked); }
+ // @returns true if token is illegal
+ constexpr bool isIllegal(Token tok) { return Token::Illegal <= tok && tok < Token::IllegalEnd; };
+
inline Token AssignmentToBinaryOp(Token op)
{
solAssert(isAssignmentOp(op) && op != Token::Assign, "");