| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library tree_ir_nodes; | 5 library tree_ir_nodes; |
| 6 | 6 |
| 7 import '../constants/expressions.dart'; | 7 import '../constants/expressions.dart'; |
| 8 import '../constants/values.dart' as values; | 8 import '../constants/values.dart' as values; |
| 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; | 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; |
| 10 import '../dart_types.dart' show DartType, GenericType; | 10 import '../dart_types.dart' show DartType, GenericType; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 final List<LiteralMapEntry> entries; | 235 final List<LiteralMapEntry> entries; |
| 236 | 236 |
| 237 LiteralMap(this.type, this.entries); | 237 LiteralMap(this.type, this.entries); |
| 238 | 238 |
| 239 accept(ExpressionVisitor visitor) => visitor.visitLiteralMap(this); | 239 accept(ExpressionVisitor visitor) => visitor.visitLiteralMap(this); |
| 240 } | 240 } |
| 241 | 241 |
| 242 class TypeOperator extends Expression { | 242 class TypeOperator extends Expression { |
| 243 Expression receiver; | 243 Expression receiver; |
| 244 final DartType type; | 244 final DartType type; |
| 245 final String operator; | 245 final bool isTypeTest; |
| 246 | 246 |
| 247 TypeOperator(this.receiver, this.type, this.operator) ; | 247 TypeOperator(this.receiver, this.type, {bool this.isTypeTest}); |
| 248 | 248 |
| 249 accept(ExpressionVisitor visitor) => visitor.visitTypeOperator(this); | 249 accept(ExpressionVisitor visitor) => visitor.visitTypeOperator(this); |
| 250 |
| 251 String get operator => isTypeTest ? 'is' : 'as'; |
| 250 } | 252 } |
| 251 | 253 |
| 252 /// A conditional expression. | 254 /// A conditional expression. |
| 253 class Conditional extends Expression { | 255 class Conditional extends Expression { |
| 254 Expression condition; | 256 Expression condition; |
| 255 Expression thenExpression; | 257 Expression thenExpression; |
| 256 Expression elseExpression; | 258 Expression elseExpression; |
| 257 | 259 |
| 258 Conditional(this.condition, this.thenExpression, this.elseExpression); | 260 Conditional(this.condition, this.thenExpression, this.elseExpression); |
| 259 | 261 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 visitFunctionDeclaration(FunctionDeclaration node) { | 655 visitFunctionDeclaration(FunctionDeclaration node) { |
| 654 visitFunctionDefinition(node.definition); | 656 visitFunctionDefinition(node.definition); |
| 655 visitStatement(node.next); | 657 visitStatement(node.next); |
| 656 } | 658 } |
| 657 | 659 |
| 658 visitExpressionStatement(ExpressionStatement node) { | 660 visitExpressionStatement(ExpressionStatement node) { |
| 659 visitExpression(node.expression); | 661 visitExpression(node.expression); |
| 660 visitStatement(node.next); | 662 visitStatement(node.next); |
| 661 } | 663 } |
| 662 } | 664 } |
| OLD | NEW |