Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: pkg/front_end/lib/src/fasta/scanner/token.dart

Issue 2691213005: Use identical in token operators. (Closed)
Patch Set: Ensure operator names are canonicalized by deserializer. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/precedence.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/scanner/token.dart
diff --git a/pkg/front_end/lib/src/fasta/scanner/token.dart b/pkg/front_end/lib/src/fasta/scanner/token.dart
index 8a7222867abbf5ff0cb2a473df3b25359ee359d0..7bded75413d13b06a90a9bf0681a3c374a5b9b6e 100644
--- a/pkg/front_end/lib/src/fasta/scanner/token.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/token.dart
@@ -350,27 +350,27 @@ bool isUserDefinableOperator(String value) {
isUnaryOperator(value);
}
-bool isUnaryOperator(String value) => value == '~';
+bool isUnaryOperator(String value) => identical(value, "~");
bool isBinaryOperator(String value) {
- return value == '==' ||
- value == '[]' ||
- value == '*' ||
- value == '/' ||
- value == '%' ||
- value == '~/' ||
- value == '+' ||
- value == '<<' ||
- value == '>>' ||
- value == '>=' ||
- value == '>' ||
- value == '<=' ||
- value == '<' ||
- value == '&' ||
- value == '^' ||
- value == '|';
+ return identical(value, "==") ||
+ identical(value, "[]") ||
+ identical(value, "*") ||
+ identical(value, "/") ||
+ identical(value, "%") ||
+ identical(value, "~/") ||
+ identical(value, "+") ||
+ identical(value, "<<") ||
+ identical(value, ">>") ||
+ identical(value, ">=") ||
+ identical(value, ">") ||
+ identical(value, "<=") ||
+ identical(value, "<") ||
+ identical(value, "&") ||
+ identical(value, "^") ||
+ identical(value, "|");
}
-bool isTernaryOperator(String value) => value == '[]=';
+bool isTernaryOperator(String value) => identical(value, "[]=");
-bool isMinusOperator(String value) => value == '-';
+bool isMinusOperator(String value) => identical(value, "-");
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/precedence.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698