| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 import 'package:kernel/frontend/accessors.dart' | 6 import 'package:kernel/frontend/accessors.dart' |
| 7 show | 7 show |
| 8 Accessor, | 8 Accessor, |
| 9 IndexAccessor, | 9 IndexAccessor, |
| 10 NullAwarePropertyAccessor, | 10 NullAwarePropertyAccessor, |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 return new ir.IntLiteral(node.value); | 854 return new ir.IntLiteral(node.value); |
| 855 } | 855 } |
| 856 | 856 |
| 857 @override | 857 @override |
| 858 ir.ListLiteral visitLiteralList(LiteralList node) { | 858 ir.ListLiteral visitLiteralList(LiteralList node) { |
| 859 // TODO(ahe): Type arguments. | 859 // TODO(ahe): Type arguments. |
| 860 List<ir.Expression> elements = <ir.Expression>[]; | 860 List<ir.Expression> elements = <ir.Expression>[]; |
| 861 for (Expression element in node.elements.nodes) { | 861 for (Expression element in node.elements.nodes) { |
| 862 elements.add(visitForValue(element)); | 862 elements.add(visitForValue(element)); |
| 863 } | 863 } |
| 864 return new ir.ListLiteral(elements, | 864 return associateNode( |
| 865 typeArgument: computeTypeFromTypes(node.typeArguments), | 865 new ir.ListLiteral(elements, |
| 866 // TODO(ahe): Should constness be validated? | 866 typeArgument: computeTypeFromTypes(node.typeArguments), |
| 867 isConst: node.isConst); | 867 // TODO(ahe): Should constness be validated? |
| 868 isConst: node.isConst), |
| 869 node); |
| 868 } | 870 } |
| 869 | 871 |
| 870 @override | 872 @override |
| 871 ir.MapLiteral visitLiteralMap(LiteralMap node) { | 873 ir.MapLiteral visitLiteralMap(LiteralMap node) { |
| 872 // TODO(ahe): Type arguments. | 874 // TODO(ahe): Type arguments. |
| 873 List<ir.MapEntry> entries = <ir.MapEntry>[]; | 875 List<ir.MapEntry> entries = <ir.MapEntry>[]; |
| 874 for (LiteralMapEntry entry in node.entries.nodes) { | 876 for (LiteralMapEntry entry in node.entries.nodes) { |
| 875 entries.add(new ir.MapEntry( | 877 entries.add(new ir.MapEntry( |
| 876 visitForValue(entry.key), visitForValue(entry.value))); | 878 visitForValue(entry.key), visitForValue(entry.value))); |
| 877 } | 879 } |
| (...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2748 : this(null, true, node, initializers); | 2750 : this(null, true, node, initializers); |
| 2749 | 2751 |
| 2750 accept(ir.Visitor v) => throw "unsupported"; | 2752 accept(ir.Visitor v) => throw "unsupported"; |
| 2751 | 2753 |
| 2752 visitChildren(ir.Visitor v) => throw "unsupported"; | 2754 visitChildren(ir.Visitor v) => throw "unsupported"; |
| 2753 | 2755 |
| 2754 String toString() { | 2756 String toString() { |
| 2755 return "IrFunction($kind, $isConstructor, $node, $initializers)"; | 2757 return "IrFunction($kind, $isConstructor, $node, $initializers)"; |
| 2756 } | 2758 } |
| 2757 } | 2759 } |
| OLD | NEW |