Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 1167733004: Decide if unit without directives is a part or a library. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after
2664 HashSet<Source> importedSourceSet = 2664 HashSet<Source> importedSourceSet =
2665 new HashSet.from(explicitlyImportedSourceSet); 2665 new HashSet.from(explicitlyImportedSourceSet);
2666 Source coreLibrarySource = context.sourceFactory.forUri(DartSdk.DART_CORE); 2666 Source coreLibrarySource = context.sourceFactory.forUri(DartSdk.DART_CORE);
2667 importedSourceSet.add(coreLibrarySource); 2667 importedSourceSet.add(coreLibrarySource);
2668 // 2668 //
2669 // Compute kind. 2669 // Compute kind.
2670 // 2670 //
2671 SourceKind sourceKind = SourceKind.LIBRARY; 2671 SourceKind sourceKind = SourceKind.LIBRARY;
2672 if (modificationTime == -1) { 2672 if (modificationTime == -1) {
2673 sourceKind = SourceKind.UNKNOWN; 2673 sourceKind = SourceKind.UNKNOWN;
2674 } else if (!hasNonPartOfDirective && hasPartOfDirective) { 2674 } else if (hasNonPartOfDirective) {
2675 sourceKind = SourceKind.LIBRARY;
2676 } else if (hasPartOfDirective) {
2675 sourceKind = SourceKind.PART; 2677 sourceKind = SourceKind.PART;
2678 } else {
2679 if (context.getLibrariesContaining(source).isEmpty) {
Brian Wilkerson 2015/06/02 22:01:53 While this is better, it doesn't work reliably. If
scheglov 2015/06/02 22:56:41 Right. That's there is also the change in DartWork
2680 sourceKind = SourceKind.LIBRARY;
2681 } else {
2682 sourceKind = SourceKind.PART;
2683 }
2676 } 2684 }
2677 // 2685 //
2678 // Record outputs. 2686 // Record outputs.
2679 // 2687 //
2680 List<Source> explicitlyImportedSources = 2688 List<Source> explicitlyImportedSources =
2681 explicitlyImportedSourceSet.toList(); 2689 explicitlyImportedSourceSet.toList();
2682 List<Source> exportedSources = exportedSourceSet.toList(); 2690 List<Source> exportedSources = exportedSourceSet.toList();
2683 List<Source> importedSources = importedSourceSet.toList(); 2691 List<Source> importedSources = importedSourceSet.toList();
2684 List<Source> includedSources = includedSourceSet.toList(); 2692 List<Source> includedSources = includedSourceSet.toList();
2685 List<AnalysisError> parseErrors = errorListener.errors; 2693 List<AnalysisError> parseErrors = errorListener.errors;
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
3374 @override 3382 @override
3375 bool moveNext() { 3383 bool moveNext() {
3376 if (_newSources.isEmpty) { 3384 if (_newSources.isEmpty) {
3377 return false; 3385 return false;
3378 } 3386 }
3379 currentTarget = _newSources.first; 3387 currentTarget = _newSources.first;
3380 _newSources.remove(currentTarget); 3388 _newSources.remove(currentTarget);
3381 return true; 3389 return true;
3382 } 3390 }
3383 } 3391 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/dart_work_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698