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

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

Issue 2229603003: Extract unresolved AST parsing (PARSED_UNIT1) from full parsing, which includes UriBasedDirective(s… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update task graph. Created 4 years, 4 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 | « pkg/analyzer/doc/tasks.html ('k') | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/context.dart
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index 24bf8d5720b39952e9c5f7cb9f2d3313337ffe04..55519d0eb88120165e3fbfca0f4bd0aeb8b7aa4c 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -1277,7 +1277,9 @@ class AnalysisContextImpl implements InternalAnalysisContext {
setValue(LIBRARY_ELEMENT9, library);
setValue(LINE_INFO, new LineInfo(<int>[0]));
setValue(PARSE_ERRORS, AnalysisError.NO_ERRORS);
+ entry.setState(PARSED_UNIT1, CacheState.FLUSHED);
entry.setState(PARSED_UNIT, CacheState.FLUSHED);
+ setValue(RESOLVE_DIRECTIVES_ERRORS, AnalysisError.NO_ERRORS);
entry.setState(RESOLVE_TYPE_NAMES_ERRORS, CacheState.FLUSHED);
entry.setState(RESOLVE_TYPE_BOUNDS_ERRORS, CacheState.FLUSHED);
setValue(SCAN_ERRORS, AnalysisError.NO_ERRORS);
@@ -1373,6 +1375,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
@override
void test_flushAstStructures(Source source) {
CacheEntry entry = getCacheEntry(source);
+ entry.setState(PARSED_UNIT1, CacheState.FLUSHED);
entry.setState(PARSED_UNIT, CacheState.FLUSHED);
entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED);
entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED);
@@ -1658,6 +1661,14 @@ class AnalysisContextImpl implements InternalAnalysisContext {
} else if (state == CacheState.ERROR) {
return;
}
+ state = entry.getState(RESOLVE_DIRECTIVES_ERRORS);
+ if (state == CacheState.INVALID ||
+ (isPriority && state == CacheState.FLUSHED)) {
+ sources.add(source);
+ return;
+ } else if (state == CacheState.ERROR) {
+ return;
+ }
// if (isPriority) {
// if (!entry.hasResolvableCompilationUnit) {
// sources.add(source);
@@ -1862,6 +1873,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
AnalysisEngine.isDartFileName(source.fullName)) {
// TODO(scheglov) Incorrect implementation in general.
entry.setState(TOKEN_STREAM, CacheState.FLUSHED);
+ entry.setState(PARSED_UNIT1, CacheState.FLUSHED);
entry.setState(PARSED_UNIT, CacheState.FLUSHED);
SourceKind sourceKind = getKindOf(source);
List<Source> partSources = getResult(source, INCLUDED_PARTS);
@@ -1875,7 +1887,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
.firstWhere((unit) => unit != null, orElse: () => null);
// If we have the old unit, we can try to update it.
if (oldUnit != null) {
- CompilationUnit newUnit = parseCompilationUnit(source);
+ CompilationUnit newUnit = computeResult(source, PARSED_UNIT);
IncrementalCompilationUnitElementBuilder builder =
new IncrementalCompilationUnitElementBuilder(oldUnit, newUnit);
builder.build();
« no previous file with comments | « pkg/analyzer/doc/tasks.html ('k') | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698