OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.task.dart; | 5 library analyzer.src.task.dart; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
9 | 9 |
10 import 'package:analyzer/src/context/cache.dart'; | 10 import 'package:analyzer/src/context/cache.dart'; |
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 if (libraryNameNode == null) { | 1315 if (libraryNameNode == null) { |
1316 libraryNameNode = directive.name; | 1316 libraryNameNode = directive.name; |
1317 directivesToResolve.add(directive); | 1317 directivesToResolve.add(directive); |
1318 } | 1318 } |
1319 } else if (directive is PartDirective) { | 1319 } else if (directive is PartDirective) { |
1320 PartDirective partDirective = directive; | 1320 PartDirective partDirective = directive; |
1321 StringLiteral partUri = partDirective.uri; | 1321 StringLiteral partUri = partDirective.uri; |
1322 Source partSource = partDirective.source; | 1322 Source partSource = partDirective.source; |
1323 hasPartDirective = true; | 1323 hasPartDirective = true; |
1324 CompilationUnit partUnit = partUnitMap[partSource]; | 1324 CompilationUnit partUnit = partUnitMap[partSource]; |
1325 if (partUnit != null) { | 1325 if (partUnit != null && context.exists(partSource)) { |
1326 CompilationUnitElementImpl partElement = partUnit.element; | 1326 CompilationUnitElementImpl partElement = partUnit.element; |
1327 partElement.uriOffset = partUri.offset; | 1327 partElement.uriOffset = partUri.offset; |
1328 partElement.uriEnd = partUri.end; | 1328 partElement.uriEnd = partUri.end; |
1329 partElement.uri = partDirective.uriContent; | 1329 partElement.uri = partDirective.uriContent; |
1330 // | 1330 // |
1331 // Validate that the part contains a part-of directive with the same | 1331 // Validate that the part contains a part-of directive with the same |
1332 // name as the library. | 1332 // name as the library. |
1333 // | 1333 // |
1334 String partLibraryName = | 1334 String partLibraryName = |
1335 _getPartLibraryName(partSource, partUnit, directivesToResolve); | 1335 _getPartLibraryName(partSource, partUnit, directivesToResolve); |
(...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3364 @override | 3364 @override |
3365 bool moveNext() { | 3365 bool moveNext() { |
3366 if (_newSources.isEmpty) { | 3366 if (_newSources.isEmpty) { |
3367 return false; | 3367 return false; |
3368 } | 3368 } |
3369 currentTarget = _newSources.first; | 3369 currentTarget = _newSources.first; |
3370 _newSources.remove(currentTarget); | 3370 _newSources.remove(currentTarget); |
3371 return true; | 3371 return true; |
3372 } | 3372 } |
3373 } | 3373 } |
OLD | NEW |