| 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 2663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2674 HashSet<Source> importedSourceSet = | 2674 HashSet<Source> importedSourceSet = |
| 2675 new HashSet.from(explicitlyImportedSourceSet); | 2675 new HashSet.from(explicitlyImportedSourceSet); |
| 2676 Source coreLibrarySource = context.sourceFactory.forUri(DartSdk.DART_CORE); | 2676 Source coreLibrarySource = context.sourceFactory.forUri(DartSdk.DART_CORE); |
| 2677 importedSourceSet.add(coreLibrarySource); | 2677 importedSourceSet.add(coreLibrarySource); |
| 2678 // | 2678 // |
| 2679 // Compute kind. | 2679 // Compute kind. |
| 2680 // | 2680 // |
| 2681 SourceKind sourceKind = SourceKind.LIBRARY; | 2681 SourceKind sourceKind = SourceKind.LIBRARY; |
| 2682 if (modificationTime == -1) { | 2682 if (modificationTime == -1) { |
| 2683 sourceKind = SourceKind.UNKNOWN; | 2683 sourceKind = SourceKind.UNKNOWN; |
| 2684 } else if (hasNonPartOfDirective) { | 2684 } else if (hasPartOfDirective && !hasNonPartOfDirective) { |
| 2685 sourceKind = SourceKind.LIBRARY; | |
| 2686 } else if (hasPartOfDirective) { | |
| 2687 sourceKind = SourceKind.PART; | 2685 sourceKind = SourceKind.PART; |
| 2688 } else { | |
| 2689 if (context.getLibrariesContaining(source).isEmpty) { | |
| 2690 sourceKind = SourceKind.LIBRARY; | |
| 2691 } else { | |
| 2692 sourceKind = SourceKind.PART; | |
| 2693 } | |
| 2694 } | 2686 } |
| 2695 // | 2687 // |
| 2696 // Record outputs. | 2688 // Record outputs. |
| 2697 // | 2689 // |
| 2698 List<Source> explicitlyImportedSources = | 2690 List<Source> explicitlyImportedSources = |
| 2699 explicitlyImportedSourceSet.toList(); | 2691 explicitlyImportedSourceSet.toList(); |
| 2700 List<Source> exportedSources = exportedSourceSet.toList(); | 2692 List<Source> exportedSources = exportedSourceSet.toList(); |
| 2701 List<Source> importedSources = importedSourceSet.toList(); | 2693 List<Source> importedSources = importedSourceSet.toList(); |
| 2702 List<Source> includedSources = includedSourceSet.toList(); | 2694 List<Source> includedSources = includedSourceSet.toList(); |
| 2703 List<AnalysisError> parseErrors = errorListener.errors; | 2695 List<AnalysisError> parseErrors = errorListener.errors; |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3392 @override | 3384 @override |
| 3393 bool moveNext() { | 3385 bool moveNext() { |
| 3394 if (_newSources.isEmpty) { | 3386 if (_newSources.isEmpty) { |
| 3395 return false; | 3387 return false; |
| 3396 } | 3388 } |
| 3397 currentTarget = _newSources.first; | 3389 currentTarget = _newSources.first; |
| 3398 _newSources.remove(currentTarget); | 3390 _newSources.remove(currentTarget); |
| 3399 return true; | 3391 return true; |
| 3400 } | 3392 } |
| 3401 } | 3393 } |
| OLD | NEW |