| 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 dart_codegen; | 5 library dart_codegen; |
| 6 | 6 |
| 7 import 'dart_tree.dart' as tree; | 7 import 'dart_tree.dart' as tree; |
| 8 import 'dart_printer.dart'; | 8 import 'dart_printer.dart'; |
| 9 import 'dart_tree_printer.dart' show TreePrinter; | 9 import 'dart_tree_printer.dart' show TreePrinter; |
| 10 import '../tree/tree.dart' as frontend; | 10 import '../tree/tree.dart' as frontend; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 statementBuffer = savedBuffer; | 326 statementBuffer = savedBuffer; |
| 327 fallthrough = savedFallthrough; | 327 fallthrough = savedFallthrough; |
| 328 | 328 |
| 329 visitStatement(stmt.next); | 329 visitStatement(stmt.next); |
| 330 } | 330 } |
| 331 | 331 |
| 332 Expression visitConstant(tree.Constant exp) { | 332 Expression visitConstant(tree.Constant exp) { |
| 333 return emitConstant(exp.value); | 333 return emitConstant(exp.value); |
| 334 } | 334 } |
| 335 | 335 |
| 336 Expression visitThis(tree.This exp) { |
| 337 return new This(); |
| 338 } |
| 339 |
| 336 Expression visitLiteralList(tree.LiteralList exp) { | 340 Expression visitLiteralList(tree.LiteralList exp) { |
| 337 return new LiteralList( | 341 return new LiteralList( |
| 338 exp.values.map(visitExpression).toList(growable: false), | 342 exp.values.map(visitExpression).toList(growable: false), |
| 339 isConst: exp.constant != null, | 343 isConst: exp.constant != null, |
| 340 typeArgument: emitOptionalType(exp.type.typeArguments.single)); | 344 typeArgument: emitOptionalType(exp.type.typeArguments.single)); |
| 341 } | 345 } |
| 342 | 346 |
| 343 Expression visitLiteralMap(tree.LiteralMap exp) { | 347 Expression visitLiteralMap(tree.LiteralMap exp) { |
| 344 List<LiteralMapEntry> entries = new List<LiteralMapEntry>.generate( | 348 List<LiteralMapEntry> entries = new List<LiteralMapEntry>.generate( |
| 345 exp.values.length, | 349 exp.values.length, |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 } else if (constant is dart2js.TypeConstant) { | 515 } else if (constant is dart2js.TypeConstant) { |
| 512 GenericType type = constant.representedType; | 516 GenericType type = constant.representedType; |
| 513 return new Identifier(type.name) | 517 return new Identifier(type.name) |
| 514 ..element = type.element; | 518 ..element = type.element; |
| 515 } else { | 519 } else { |
| 516 throw "Unsupported constant: $constant"; | 520 throw "Unsupported constant: $constant"; |
| 517 } | 521 } |
| 518 } | 522 } |
| 519 } | 523 } |
| 520 | 524 |
| OLD | NEW |