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

Unified Diff: pkg/analyzer/lib/src/analyzer_impl.dart

Issue 205243008: Partial fix for AST cloning (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/analyzer_impl.dart
diff --git a/pkg/analyzer/lib/src/analyzer_impl.dart b/pkg/analyzer/lib/src/analyzer_impl.dart
index efc97a1bd314fe873c98377ac363b45e02914d39..b91aa1073fb41a4c03780594edb7b698ece4ee34 100644
--- a/pkg/analyzer/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer/lib/src/analyzer_impl.dart
@@ -10,7 +10,6 @@ import 'dart:io';
import 'package:path/path.dart' as pathos;
-import 'generated/ast.dart';
import 'generated/engine.dart';
import 'generated/element.dart';
import 'generated/error.dart';
@@ -95,15 +94,8 @@ class AnalyzerImpl {
/// The sync version of analysis
ErrorSeverity _analyzeSync() {
- // don't try to analyzer parts
- var unit = context.parseCompilationUnit(librarySource);
- var hasLibraryDirective = false;
- var hasPartOfDirective = false;
- for (var directive in unit.directives) {
- if (directive is LibraryDirective) hasLibraryDirective = true;
- if (directive is PartOfDirective) hasPartOfDirective = true;
- }
- if (hasPartOfDirective && !hasLibraryDirective) {
+ // don't try to analyze parts
+ if (context.getKindOf(librarySource) == SourceKind.PART) {
print("Only libraries can be analyzed.");
print("$sourcePath is a part and can not be analyzed.");
return ErrorSeverity.ERROR;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698