aboutsummaryrefslogtreecommitdiffstats
path: root/liblangutil/Token.h
diff options
context:
space:
mode:
authorChristian Parpart <christian@ethereum.org>2018-11-23 23:47:34 +0800
committerChristian Parpart <christian@ethereum.org>2018-11-24 19:40:51 +0800
commite4106bd06eebce9e17d51858a37bf82566b7f640 (patch)
treed5437b94d64673870c73a946b10bcf6778ec3594 /liblangutil/Token.h
parente454737a3cf389ee400a9ef1d9f252c579a2ceea (diff)
downloaddexon-solidity-e4106bd06eebce9e17d51858a37bf82566b7f640.tar.gz
dexon-solidity-e4106bd06eebce9e17d51858a37bf82566b7f640.tar.zst
dexon-solidity-e4106bd06eebce9e17d51858a37bf82566b7f640.zip
Change scanner error diagnostics to be non-intrusive to the token API.
This also implicitly eliminates the magic-token Token::IllegalHex, and streamlines error diagnostics over a custom enum class.
Diffstat (limited to 'liblangutil/Token.h')
-rw-r--r--liblangutil/Token.h14
1 files changed, 0 insertions, 14 deletions
diff --git a/liblangutil/Token.h b/liblangutil/Token.h
index 55d474f5..f832fdf7 100644
--- a/liblangutil/Token.h
+++ b/liblangutil/Token.h
@@ -263,17 +263,6 @@ namespace langutil
\
/* Illegal token - not able to scan. */ \
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)
@@ -321,9 +310,6 @@ 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, "");