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 analyzer.src.dart.element.builder; | 5 library analyzer.src.dart.element.builder; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // | 162 // |
163 libraryElement.imports = imports; | 163 libraryElement.imports = imports; |
164 libraryElement.exports = exports; | 164 libraryElement.exports = exports; |
165 return null; | 165 return null; |
166 } | 166 } |
167 | 167 |
168 @override | 168 @override |
169 Object visitExportDirective(ExportDirective node) { | 169 Object visitExportDirective(ExportDirective node) { |
170 // Remove previous element. (It will remain null if the target is missing.) | 170 // Remove previous element. (It will remain null if the target is missing.) |
171 node.element = null; | 171 node.element = null; |
172 Source exportedSource = node.source; | 172 Source exportedSource = node.selectedSource; |
173 int exportedTime = sourceModificationTimeMap[exportedSource] ?? -1; | 173 int exportedTime = sourceModificationTimeMap[exportedSource] ?? -1; |
174 // The exported source will be null if the URI in the export | 174 // The exported source will be null if the URI in the export |
175 // directive was invalid. | 175 // directive was invalid. |
176 LibraryElement exportedLibrary = exportLibraryMap[exportedSource]; | 176 LibraryElement exportedLibrary = exportLibraryMap[exportedSource]; |
177 if (exportedLibrary != null) { | 177 if (exportedLibrary != null) { |
178 ExportElementImpl exportElement = new ExportElementImpl(node.offset); | 178 ExportElementImpl exportElement = new ExportElementImpl(node.offset); |
179 exportElement.metadata = _getElementAnnotations(node.metadata); | 179 exportElement.metadata = _getElementAnnotations(node.metadata); |
180 StringLiteral uriLiteral = node.uri; | 180 StringLiteral uriLiteral = node.uri; |
181 if (uriLiteral != null) { | 181 if (uriLiteral != null) { |
182 exportElement.uriOffset = uriLiteral.offset; | 182 exportElement.uriOffset = uriLiteral.offset; |
(...skipping 21 matching lines...) Expand all Loading... |
204 [uriLiteral.toSource()])); | 204 [uriLiteral.toSource()])); |
205 } | 205 } |
206 } | 206 } |
207 return null; | 207 return null; |
208 } | 208 } |
209 | 209 |
210 @override | 210 @override |
211 Object visitImportDirective(ImportDirective node) { | 211 Object visitImportDirective(ImportDirective node) { |
212 // Remove previous element. (It will remain null if the target is missing.) | 212 // Remove previous element. (It will remain null if the target is missing.) |
213 node.element = null; | 213 node.element = null; |
214 Source importedSource = node.source; | 214 Source importedSource = node.selectedSource; |
215 int importedTime = sourceModificationTimeMap[importedSource] ?? -1; | 215 int importedTime = sourceModificationTimeMap[importedSource] ?? -1; |
216 // The imported source will be null if the URI in the import | 216 // The imported source will be null if the URI in the import |
217 // directive was invalid. | 217 // directive was invalid. |
218 LibraryElement importedLibrary = importLibraryMap[importedSource]; | 218 LibraryElement importedLibrary = importLibraryMap[importedSource]; |
219 if (importedLibrary != null) { | 219 if (importedLibrary != null) { |
220 if (importedLibrary.isDartCore) { | 220 if (importedLibrary.isDartCore) { |
221 explicitlyImportsCore = true; | 221 explicitlyImportsCore = true; |
222 } | 222 } |
223 ImportElementImpl importElement = new ImportElementImpl(node.offset); | 223 ImportElementImpl importElement = new ImportElementImpl(node.offset); |
224 importElement.metadata = _getElementAnnotations(node.metadata); | 224 importElement.metadata = _getElementAnnotations(node.metadata); |
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1456 return null; | 1456 return null; |
1457 } | 1457 } |
1458 | 1458 |
1459 /** | 1459 /** |
1460 * Return the lexical identifiers associated with the given [identifiers]. | 1460 * Return the lexical identifiers associated with the given [identifiers]. |
1461 */ | 1461 */ |
1462 static List<String> _getIdentifiers(NodeList<SimpleIdentifier> identifiers) { | 1462 static List<String> _getIdentifiers(NodeList<SimpleIdentifier> identifiers) { |
1463 return identifiers.map((identifier) => identifier.name).toList(); | 1463 return identifiers.map((identifier) => identifier.name).toList(); |
1464 } | 1464 } |
1465 } | 1465 } |
OLD | NEW |