| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
| 8 import 'package:compiler/implementation/source_file.dart'; | |
| 9 import 'package:compiler/implementation/types/types.dart'; | 8 import 'package:compiler/implementation/types/types.dart'; |
| 10 import 'package:compiler/implementation/inferrer/concrete_types_inferrer.dart'; | 9 import 'package:compiler/implementation/inferrer/concrete_types_inferrer.dart'; |
| 11 | 10 |
| 12 import "parser_helper.dart"; | |
| 13 import "compiler_helper.dart"; | 11 import "compiler_helper.dart"; |
| 14 import "type_mask_test_helper.dart"; | 12 import "type_mask_test_helper.dart"; |
| 15 import 'dart:mirrors'; | |
| 16 | 13 |
| 17 /** | 14 /** |
| 18 * Finds the node corresponding to the last occurence of the substring | 15 * Finds the node corresponding to the last occurence of the substring |
| 19 * [: identifier; :] in the program represented by the visited AST. | 16 * [: identifier; :] in the program represented by the visited AST. |
| 20 */ | 17 */ |
| 21 class VariableFinderVisitor extends Visitor { | 18 class VariableFinderVisitor extends Visitor { |
| 22 final String identifier; | 19 final String identifier; |
| 23 Node result; | 20 Node result; |
| 24 | 21 |
| 25 VariableFinderVisitor(this.identifier); | 22 VariableFinderVisitor(this.identifier); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 int = inferrer.baseTypes.intBaseType; | 56 int = inferrer.baseTypes.intBaseType; |
| 60 double = inferrer.baseTypes.doubleBaseType; | 57 double = inferrer.baseTypes.doubleBaseType; |
| 61 num = inferrer.baseTypes.numBaseType; | 58 num = inferrer.baseTypes.numBaseType; |
| 62 bool = inferrer.baseTypes.boolBaseType; | 59 bool = inferrer.baseTypes.boolBaseType; |
| 63 string = inferrer.baseTypes.stringBaseType; | 60 string = inferrer.baseTypes.stringBaseType; |
| 64 list = inferrer.baseTypes.listBaseType; | 61 list = inferrer.baseTypes.listBaseType; |
| 65 growableList = inferrer.baseTypes.growableListBaseType; | 62 growableList = inferrer.baseTypes.growableListBaseType; |
| 66 map = inferrer.baseTypes.mapBaseType; | 63 map = inferrer.baseTypes.mapBaseType; |
| 67 nullType = const NullBaseType(); | 64 nullType = const NullBaseType(); |
| 68 functionType = inferrer.baseTypes.functionBaseType; | 65 functionType = inferrer.baseTypes.functionBaseType; |
| 69 Element mainElement = compiler.mainApp.find('main'); | 66 FunctionElement mainElement = compiler.mainApp.find('main'); |
| 70 ast = mainElement.parseNode(compiler); | 67 ast = mainElement.node; |
| 71 } | 68 } |
| 72 | 69 |
| 73 BaseType base(String className) { | 70 BaseType base(String className) { |
| 74 final source = className; | 71 final source = className; |
| 75 return new ClassBaseType(compiler.mainApp.find(source)); | 72 return new ClassBaseType(compiler.mainApp.find(source)); |
| 76 } | 73 } |
| 77 | 74 |
| 78 /** | 75 /** |
| 79 * Finds the [Node] corresponding to the last occurence of the substring | 76 * Finds the [Node] corresponding to the last occurence of the substring |
| 80 * [: identifier; :] in the program represented by the visited AST. For | 77 * [: identifier; :] in the program represented by the visited AST. For |
| (...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2133 testClosures10, | 2130 testClosures10, |
| 2134 testClosures11, | 2131 testClosures11, |
| 2135 testClosures12, | 2132 testClosures12, |
| 2136 testRefinement, | 2133 testRefinement, |
| 2137 testDefaultArguments, | 2134 testDefaultArguments, |
| 2138 testSuperConstructorCall, | 2135 testSuperConstructorCall, |
| 2139 testSuperConstructorCall2, | 2136 testSuperConstructorCall2, |
| 2140 testSuperConstructorCall3, | 2137 testSuperConstructorCall3, |
| 2141 ], (f) => f())); | 2138 ], (f) => f())); |
| 2142 } | 2139 } |
| OLD | NEW |