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

Unified Diff: pkg/front_end/lib/src/fasta/source/source_loader.dart

Issue 2723113002: Consolidate analyzer dependencies. (Closed)
Patch Set: Remove new dependency on AsyncMarker. Created 3 years, 10 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/front_end/lib/src/fasta/source/diet_listener.dart ('k') | pkg/front_end/lib/src/fasta/target.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/source/source_loader.dart
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart
index 3df02d01a4591f01cbbb0ee54fad3bc1974db98d..cbd90b6b432f54c9334ff37b6a363532f78d6101 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -26,8 +26,6 @@ import '../messages.dart' show warning;
import '../export.dart' show Export;
-import '../analyzer/element_store.dart' show ElementStore;
-
import '../builder/builder.dart' show Builder, ClassBuilder, LibraryBuilder;
import 'outline_builder.dart' show OutlineBuilder;
@@ -42,8 +40,6 @@ import 'diet_parser.dart' show DietParser;
import 'source_library_builder.dart' show SourceLibraryBuilder;
-import '../ast_kind.dart' show AstKind;
-
class SourceLoader<L> extends Loader<L> {
final Map<Uri, List<int>> sourceBytes = <Uri, List<int>>{};
@@ -51,9 +47,6 @@ class SourceLoader<L> extends Loader<L> {
ClassHierarchy hierarchy;
CoreTypes coreTypes;
- // Used when building analyzer ASTs.
- ElementStore elementStore;
-
SourceLoader(TargetImplementation target) : super(target);
Future<Token> tokenize(SourceLibraryBuilder library,
@@ -98,15 +91,14 @@ class SourceLoader<L> extends Loader<L> {
new ClassMemberParser(listener).parseUnit(tokens);
}
- Future<Null> buildBody(LibraryBuilder library, AstKind astKind) async {
+ Future<Null> buildBody(LibraryBuilder library) async {
if (library is SourceLibraryBuilder) {
// We tokenize source files twice to keep memory usage low. This is the
// second time, and the first time was in [buildOutline] above. So this
// time we suppress lexical errors.
Token tokens = await tokenize(library, suppressLexicalErrors: true);
if (tokens == null) return;
- DietListener listener = new DietListener(
- library, elementStore, hierarchy, coreTypes, astKind);
+ DietListener listener = createDietListener(library);
DietParser parser = new DietParser(listener);
parser.parseUnit(tokens);
for (SourceLibraryBuilder part in library.parts) {
@@ -119,6 +111,10 @@ class SourceLoader<L> extends Loader<L> {
}
}
+ DietListener createDietListener(LibraryBuilder library) {
+ return new DietListener(library, hierarchy, coreTypes);
+ }
+
void resolveParts() {
List<Uri> parts = <Uri>[];
builders.forEach((Uri uri, LibraryBuilder library) {
@@ -339,11 +335,6 @@ class SourceLoader<L> extends Loader<L> {
ticker.logMs("Built program");
}
- void buildElementStore() {
- elementStore = new ElementStore(coreLibrary, builders);
- ticker.logMs("Built analyzer element model.");
- }
-
void computeHierarchy(Program program) {
hierarchy = new ClassHierarchy(program);
ticker.logMs("Computed class hierarchy");
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/diet_listener.dart ('k') | pkg/front_end/lib/src/fasta/target.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698