| Index: runtime/vm/token.h
|
| ===================================================================
|
| --- runtime/vm/token.h (revision 20450)
|
| +++ runtime/vm/token.h (working copy)
|
| @@ -293,6 +293,24 @@
|
| static bool IsBinaryOperator(Token::Kind token);
|
| static bool IsPrefixOperator(Token::Kind token);
|
|
|
| + // For a comparison operation return an operation for the negated comparison:
|
| + // !(a (op) b) === a (op') b
|
| + static Token::Kind NegateComparison(Token::Kind op) {
|
| + switch (op) {
|
| + case Token::kEQ: return Token::kNE;
|
| + case Token::kNE: return Token::kEQ;
|
| + case Token::kLT: return Token::kGTE;
|
| + case Token::kGT: return Token::kLTE;
|
| + case Token::kLTE: return Token::kGT;
|
| + case Token::kGTE: return Token::kLT;
|
| + case Token::kEQ_STRICT: return Token::kNE_STRICT;
|
| + case Token::kNE_STRICT: return Token::kEQ_STRICT;
|
| + default:
|
| + UNREACHABLE();
|
| + return Token::kILLEGAL;
|
| + }
|
| + }
|
| +
|
| private:
|
| static const char* name_[];
|
| static const char* tok_str_[];
|
|
|