diff options
author | Christian Parpart <christian@ethereum.org> | 2018-11-23 23:47:34 +0800 |
---|---|---|
committer | Christian Parpart <christian@ethereum.org> | 2018-11-24 19:40:51 +0800 |
commit | e4106bd06eebce9e17d51858a37bf82566b7f640 (patch) | |
tree | d5437b94d64673870c73a946b10bcf6778ec3594 /liblangutil/Token.h | |
parent | e454737a3cf389ee400a9ef1d9f252c579a2ceea (diff) | |
download | dexon-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.h | 14 |
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, ""); |