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

Unified Diff: pkg/front_end/lib/src/fasta/operator.dart

Issue 2682113003: Revert "Use ProcedureKind.Operator for operators." (Closed)
Patch Set: 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 | « no previous file | pkg/front_end/lib/src/fasta/source/outline_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/operator.dart
diff --git a/pkg/front_end/lib/src/fasta/operator.dart b/pkg/front_end/lib/src/fasta/operator.dart
deleted file mode 100644
index ae0e7cd2abad979ddabef42715486d6976af8a4c..0000000000000000000000000000000000000000
--- a/pkg/front_end/lib/src/fasta/operator.dart
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library fasta.operators;
-
-/// The user-definable operators in Dart.
-///
-/// The names have been chosen to represent their normal semantic meaning.
-enum Operator {
- add,
- bitwiseAnd,
- bitwiseNot,
- bitwiseOr,
- bitwiseXor,
- divide,
- equals,
- greaterThan,
- greaterThanEquals,
- index,
ahe 2017/02/08 14:44:16 "index" is also a static method on an enum.
Lasse Reichstein Nielsen 2017/02/08 14:48:44 Enums suck. 'nuff said.
- indexSet,
- leftShift,
- lessThan,
- lessThanEquals,
- modulo,
- multiply,
- rightShift,
- subtract,
- truncatingDivide,
- unaryMinus,
-}
-
-Operator operatorFromString(String string) {
- if (identical("+", string)) return Operator.add;
- if (identical("&", string)) return Operator.bitwiseAnd;
- if (identical("~", string)) return Operator.bitwiseNot;
- if (identical("|", string)) return Operator.bitwiseOr;
- if (identical("^", string)) return Operator.bitwiseXor;
- if (identical("/", string)) return Operator.divide;
- if (identical("==", string)) return Operator.equals;
- if (identical(">", string)) return Operator.greaterThan;
- if (identical(">=", string)) return Operator.greaterThanEquals;
- if (identical("[]", string)) return Operator.index;
- if (identical("[]=", string)) return Operator.indexSet;
- if (identical("<<", string)) return Operator.leftShift;
- if (identical("<", string)) return Operator.lessThan;
- if (identical("<=", string)) return Operator.lessThanEquals;
- if (identical("%", string)) return Operator.modulo;
- if (identical("*", string)) return Operator.multiply;
- if (identical(">>", string)) return Operator.rightShift;
- if (identical("-", string)) return Operator.subtract;
- if (identical("~/", string)) return Operator.truncatingDivide;
- if (identical("unary-", string)) return Operator.unaryMinus;
- return null;
-}
-
-String operatorToString(Operator operator) {
- switch (operator) {
- case Operator.add: return "+";
- case Operator.bitwiseAnd: return "&";
- case Operator.bitwiseNot: return "~";
- case Operator.bitwiseOr: return "|";
- case Operator.bitwiseXor: return "^";
- case Operator.divide: return "/";
- case Operator.equals: return "==";
- case Operator.greaterThan: return ">";
- case Operator.greaterThanEquals: return ">=";
- case Operator.index: return "[]";
- case Operator.indexSet: return "[]=";
- case Operator.leftShift: return "<<";
- case Operator.lessThan: return "<";
- case Operator.lessThanEquals: return "<=";
- case Operator.modulo: return "%";
- case Operator.multiply: return "*";
- case Operator.rightShift: return ">>";
- case Operator.subtract: return "-";
- case Operator.truncatingDivide: return "~/";
- case Operator.unaryMinus: return "unary-";
- }
-}
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/source/outline_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698