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

Unified Diff: pkg/compiler/lib/src/constants/constant_system.dart

Issue 1859343004: dartfmt pkg/compiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
Index: pkg/compiler/lib/src/constants/constant_system.dart
diff --git a/pkg/compiler/lib/src/constants/constant_system.dart b/pkg/compiler/lib/src/constants/constant_system.dart
index 06c9fad9740a89c13f0933538433c79963332c8c..aae267f05601f31c676406e47684b731c384522b 100644
--- a/pkg/compiler/lib/src/constants/constant_system.dart
+++ b/pkg/compiler/lib/src/constants/constant_system.dart
@@ -5,11 +5,9 @@
library dart2js.constant_system;
import '../dart_types.dart';
-import '../compiler.dart' show
- Compiler;
+import '../compiler.dart' show Compiler;
import '../resolution/operators.dart';
-import '../tree/tree.dart' show
- DartString;
+import '../tree/tree.dart' show DartString;
import 'values.dart';
abstract class Operation {
@@ -64,16 +62,12 @@ abstract class ConstantSystem {
ConstantValue createString(DartString string);
ConstantValue createBool(bool value);
ConstantValue createNull();
- ConstantValue createList(InterfaceType type,
- List<ConstantValue> values);
+ ConstantValue createList(InterfaceType type, List<ConstantValue> values);
// TODO(johnniwinther): Remove the need for [compiler].
- ConstantValue createMap(Compiler compiler,
- InterfaceType type,
- List<ConstantValue> keys,
- List<ConstantValue> values);
+ ConstantValue createMap(Compiler compiler, InterfaceType type,
+ List<ConstantValue> keys, List<ConstantValue> values);
// TODO(johnniwinther): Remove the need for [compiler].
- ConstantValue createType(Compiler compiler,
- DartType type);
+ ConstantValue createType(Compiler compiler, DartType type);
// We need to special case the subtype check for JavaScript constant
// system because an int is a double at runtime.
@@ -92,35 +86,59 @@ abstract class ConstantSystem {
UnaryOperation lookupUnary(UnaryOperator operator) {
switch (operator.kind) {
- case UnaryOperatorKind.COMPLEMENT: return bitNot;
- case UnaryOperatorKind.NEGATE: return negate;
- case UnaryOperatorKind.NOT: return not;
- default: return null;
+ case UnaryOperatorKind.COMPLEMENT:
+ return bitNot;
+ case UnaryOperatorKind.NEGATE:
+ return negate;
+ case UnaryOperatorKind.NOT:
+ return not;
+ default:
+ return null;
}
}
BinaryOperation lookupBinary(BinaryOperator operator) {
switch (operator.kind) {
- case BinaryOperatorKind.ADD: return add;
- case BinaryOperatorKind.SUB: return subtract;
- case BinaryOperatorKind.MUL: return multiply;
- case BinaryOperatorKind.DIV: return divide;
- case BinaryOperatorKind.MOD: return modulo;
- case BinaryOperatorKind.IDIV: return truncatingDivide;
- case BinaryOperatorKind.OR: return bitOr;
- case BinaryOperatorKind.AND: return bitAnd;
- case BinaryOperatorKind.XOR: return bitXor;
- case BinaryOperatorKind.LOGICAL_OR: return booleanOr;
- case BinaryOperatorKind.LOGICAL_AND: return booleanAnd;
- case BinaryOperatorKind.SHL: return shiftLeft;
- case BinaryOperatorKind.SHR: return shiftRight;
- case BinaryOperatorKind.LT: return less;
- case BinaryOperatorKind.LTEQ: return lessEqual;
- case BinaryOperatorKind.GT: return greater;
- case BinaryOperatorKind.GTEQ: return greaterEqual;
- case BinaryOperatorKind.EQ: return equal;
- case BinaryOperatorKind.IF_NULL: return ifNull;
- default: return null;
+ case BinaryOperatorKind.ADD:
+ return add;
+ case BinaryOperatorKind.SUB:
+ return subtract;
+ case BinaryOperatorKind.MUL:
+ return multiply;
+ case BinaryOperatorKind.DIV:
+ return divide;
+ case BinaryOperatorKind.MOD:
+ return modulo;
+ case BinaryOperatorKind.IDIV:
+ return truncatingDivide;
+ case BinaryOperatorKind.OR:
+ return bitOr;
+ case BinaryOperatorKind.AND:
+ return bitAnd;
+ case BinaryOperatorKind.XOR:
+ return bitXor;
+ case BinaryOperatorKind.LOGICAL_OR:
+ return booleanOr;
+ case BinaryOperatorKind.LOGICAL_AND:
+ return booleanAnd;
+ case BinaryOperatorKind.SHL:
+ return shiftLeft;
+ case BinaryOperatorKind.SHR:
+ return shiftRight;
+ case BinaryOperatorKind.LT:
+ return less;
+ case BinaryOperatorKind.LTEQ:
+ return lessEqual;
+ case BinaryOperatorKind.GT:
+ return greater;
+ case BinaryOperatorKind.GTEQ:
+ return greaterEqual;
+ case BinaryOperatorKind.EQ:
+ return equal;
+ case BinaryOperatorKind.IF_NULL:
+ return ifNull;
+ default:
+ return null;
}
}
}
« no previous file with comments | « pkg/compiler/lib/src/constants/constant_constructors.dart ('k') | pkg/compiler/lib/src/constants/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698