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

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

Issue 1034493004: Add UNITS and CLASS_ELEMENTS results. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | pkg/analyzer/lib/task/dart.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index a731cd19b7e4334292e59b7feeda108aff71c1e7..9e5bbf63f7525c73ee27f11a298e21ea480ff2b5 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -61,6 +61,12 @@ final ResultDescriptor<List<AnalysisError>> BUILD_LIBRARY_ERRORS =
contributesTo: DART_ERRORS);
/**
+ * The [ClassElement]s of a [LibraryUnitTarget].
+ */
+final ResultDescriptor<List<ClassElement>> CLASS_ELEMENTS =
+ new ResultDescriptor<List<ClassElement>>('CLASS_ELEMENTS', null);
+
+/**
* The sources representing the export closure of a library.
*
* The result is only available for targets representing a Dart library.
@@ -202,7 +208,11 @@ class BuildCompilationUnitElementTask extends SourceBasedAnalysisTask {
*/
static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
'BuildCompilationUnitElementTask', createTask, buildInputs,
- <ResultDescriptor>[COMPILATION_UNIT_ELEMENT, RESOLVED_UNIT1]);
+ <ResultDescriptor>[
+ CLASS_ELEMENTS,
+ COMPILATION_UNIT_ELEMENT,
+ RESOLVED_UNIT1
+ ]);
/**
* Initialize a newly created task to build a compilation unit element for
@@ -231,6 +241,7 @@ class BuildCompilationUnitElementTask extends SourceBasedAnalysisTask {
//
// Record outputs.
//
+ outputs[CLASS_ELEMENTS] = element.types;
outputs[COMPILATION_UNIT_ELEMENT] = element;
outputs[RESOLVED_UNIT1] = unit;
}
@@ -1329,7 +1340,8 @@ class ParseDartTask extends SourceBasedAnalysisTask {
INCLUDED_PARTS,
PARSE_ERRORS,
PARSED_UNIT,
- SOURCE_KIND
+ SOURCE_KIND,
+ UNITS
]);
/**
@@ -1406,6 +1418,7 @@ class ParseDartTask extends SourceBasedAnalysisTask {
outputs[PARSE_ERRORS] = errorListener.getErrorsForSource(source);
outputs[PARSED_UNIT] = unit;
outputs[SOURCE_KIND] = sourceKind;
+ outputs[UNITS] = <Source>[source]..addAll(includedSources);
}
/**
@@ -1548,11 +1561,9 @@ class ResolveLibraryTypeNamesTask extends SourceBasedAnalysisTask {
static Map<String, TaskInput> buildInputs(Source libSource) {
return <String, TaskInput>{
LIBRARY_INPUT: LIBRARY_ELEMENT4.inputFor(libSource),
- 'resolvedDefiningUnit':
- RESOLVED_UNIT4.inputFor(new LibraryUnitTarget(libSource, libSource)),
- 'resolvedPartsUnit': new ListToMapTaskInput<Source, CompilationUnit>(
- INCLUDED_PARTS.inputFor(libSource), (Source source) => RESOLVED_UNIT4
- .inputFor(new LibraryUnitTarget(libSource, source))),
+ 'resolvedUnits': new ListToMapTaskInput<Source, CompilationUnit>(
+ UNITS.inputFor(libSource), (Source source) =>
+ RESOLVED_UNIT4.inputFor(new LibraryUnitTarget(libSource, source)))
};
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698