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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 library kernel.import_table; | 4 library kernel.import_table; |
5 | 5 |
6 import 'ast.dart'; | 6 import 'ast.dart'; |
7 import 'package:path/path.dart' as path; | 7 import 'package:path/path.dart' as path; |
8 | 8 |
9 abstract class ImportTable { | 9 abstract class ImportTable { |
10 int getImportIndex(Library library); | 10 int getImportIndex(Library library); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 throw '$referenceUri cannot refer to application library $targetUri'; | 95 throw '$referenceUri cannot refer to application library $targetUri'; |
96 } else { | 96 } else { |
97 table.addImport(target, target.importUri.toString()); | 97 table.addImport(target, target.importUri.toString()); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 visitClassReference(Class node) { | 101 visitClassReference(Class node) { |
102 addLibraryImport(node.enclosingLibrary); | 102 addLibraryImport(node.enclosingLibrary); |
103 } | 103 } |
104 | 104 |
105 visitLibrary(Library node) { | |
106 super.visitLibrary(node); | |
107 for (Reference exportedReference in node.additionalExports) { | |
108 addLibraryImport(exportedReference.node.parent); | |
109 } | |
110 } | |
111 | |
112 defaultMemberReference(Member node) { | 105 defaultMemberReference(Member node) { |
113 addLibraryImport(node.enclosingLibrary); | 106 addLibraryImport(node.enclosingLibrary); |
114 } | 107 } |
115 | 108 |
116 visitName(Name name) { | 109 visitName(Name name) { |
117 if (name.library != null) { | 110 if (name.library != null) { |
118 addLibraryImport(name.library); | 111 addLibraryImport(name.library); |
119 } | 112 } |
120 } | 113 } |
121 } | 114 } |
OLD | NEW |