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

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

Issue 1132103002: Remove memento. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/driver.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 4b88e7df31b04b55abc226ba834cd80a91e57cc7..9bab7fde80e1e644f3215b344f7fd48b8a5bdae7 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -19,7 +19,6 @@ import 'package:analyzer/src/generated/scanner.dart';
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/task/general.dart';
-import 'package:analyzer/src/task/incremental_element_builder.dart';
import 'package:analyzer/src/task/model.dart';
import 'package:analyzer/task/dart.dart';
import 'package:analyzer/task/general.dart';
@@ -574,17 +573,6 @@ class BuildClassConstructorsTask extends SourceBasedAnalysisTask {
}
/**
- * The memento for [BuildCompilationUnitElementTask].
- */
-class BuildCompilationUnitElementMemento {
- final List<ClassElement> classElements;
- final CompilationUnit unit;
- final CompilationUnitElement unitElement;
- BuildCompilationUnitElementMemento(
- this.classElements, this.unit, this.unitElement);
-}
-
-/**
* A task that builds a compilation unit element for a single compilation unit.
*/
class BuildCompilationUnitElementTask extends SourceBasedAnalysisTask {
@@ -623,21 +611,6 @@ class BuildCompilationUnitElementTask extends SourceBasedAnalysisTask {
Source source = getRequiredSource();
CompilationUnit unit = getRequiredInput(PARSED_UNIT_INPUT_NAME);
//
- // Use memento.
- //
- if (inputMemento is BuildCompilationUnitElementMemento) {
- BuildCompilationUnitElementMemento memento = inputMemento;
- unit = AstCloner.clone(unit);
- new IncrementalCompilationUnitElementBuilder(memento.unit, unit).build();
- CompilationUnitElement element = unit.element;
- outputs[CLASS_ELEMENTS] = element.types;
- outputs[COMPILATION_UNIT_ELEMENT] = element;
- outputs[RESOLVED_UNIT1] = unit;
- outputMemento =
- new BuildCompilationUnitElementMemento(element.types, unit, element);
- return;
- }
- //
// Process inputs.
//
unit = AstCloner.clone(unit);
@@ -649,8 +622,6 @@ class BuildCompilationUnitElementTask extends SourceBasedAnalysisTask {
outputs[CLASS_ELEMENTS] = element.types;
outputs[COMPILATION_UNIT_ELEMENT] = element;
outputs[RESOLVED_UNIT1] = unit;
- outputMemento =
- new BuildCompilationUnitElementMemento(element.types, unit, element);
}
/**
@@ -2203,24 +2174,6 @@ class LibraryUnitErrorsTask extends SourceBasedAnalysisTask {
}
/**
- * The memento for [ParseDartTask].
- */
-class ParseDartMemento {
- final Token inputTokenStream;
- final List<Source> explicitlyImportedLibraries;
- final List<Source> exportedLibraries;
- final List<Source> importedLibraries;
- final List<Source> includedParts;
- final List<AnalysisError> parseErrors;
- final CompilationUnit parsedUnit;
- final SourceKind sourceKind;
- final List<Source> units;
- ParseDartMemento(this.inputTokenStream, this.explicitlyImportedLibraries,
- this.exportedLibraries, this.importedLibraries, this.includedParts,
- this.parseErrors, this.parsedUnit, this.sourceKind, this.units);
-}
-
-/**
* A task that parses the content of a Dart file, producing an AST structure.
*/
class ParseDartTask extends SourceBasedAnalysisTask {
@@ -2266,23 +2219,6 @@ class ParseDartTask extends SourceBasedAnalysisTask {
LineInfo lineInfo = getRequiredInput(LINE_INFO_INPUT_NAME);
Token tokenStream = getRequiredInput(TOKEN_STREAM_INPUT_NAME);
- if (inputMemento is ParseDartMemento) {
- ParseDartMemento memento = inputMemento;
- if (identical(memento.inputTokenStream, tokenStream)) {
- outputMemento = memento;
- outputs[EXPLICITLY_IMPORTED_LIBRARIES] =
- memento.explicitlyImportedLibraries;
- outputs[EXPORTED_LIBRARIES] = memento.exportedLibraries;
- outputs[IMPORTED_LIBRARIES] = memento.importedLibraries;
- outputs[INCLUDED_PARTS] = memento.includedParts;
- outputs[PARSE_ERRORS] = memento.parseErrors;
- outputs[PARSED_UNIT] = memento.parsedUnit;
- outputs[SOURCE_KIND] = memento.sourceKind;
- outputs[UNITS] = memento.units;
- return;
- }
- }
-
RecordingErrorListener errorListener = new RecordingErrorListener();
Parser parser = new Parser(source, errorListener);
AnalysisOptions options = context.analysisOptions;
@@ -2352,9 +2288,6 @@ class ParseDartTask extends SourceBasedAnalysisTask {
outputs[PARSED_UNIT] = unit;
outputs[SOURCE_KIND] = sourceKind;
outputs[UNITS] = unitSources;
- outputMemento = new ParseDartMemento(tokenStream, explicitlyImportedSources,
- exportedSources, importedSources, includedSources, parseErrors, unit,
- sourceKind, unitSources);
}
/**
@@ -2731,17 +2664,6 @@ class ResolveVariableReferencesTask extends SourceBasedAnalysisTask {
}
/**
- * The memento for [ScanDartTask].
- */
-class ScanDartMemento {
- final String content;
- final Token tokenStream;
- final LineInfo lineInfo;
- final List<AnalysisError> errors;
- ScanDartMemento(this.content, this.tokenStream, this.lineInfo, this.errors);
-}
-
-/**
* A task that scans the content of a file, producing a set of Dart tokens.
*/
class ScanDartTask extends SourceBasedAnalysisTask {
@@ -2775,17 +2697,6 @@ class ScanDartTask extends SourceBasedAnalysisTask {
Source source = getRequiredSource();
String content = getRequiredInput(CONTENT_INPUT_NAME);
- if (inputMemento is ScanDartMemento) {
- ScanDartMemento memento = inputMemento;
- if (memento.content == content) {
- outputMemento = memento;
- outputs[TOKEN_STREAM] = memento.tokenStream;
- outputs[LINE_INFO] = memento.lineInfo;
- outputs[SCAN_ERRORS] = memento.errors;
- return;
- }
- }
-
RecordingErrorListener errorListener = new RecordingErrorListener();
Scanner scanner =
new Scanner(source, new CharSequenceReader(content), errorListener);
@@ -2799,7 +2710,6 @@ class ScanDartTask extends SourceBasedAnalysisTask {
outputs[TOKEN_STREAM] = tokenStream;
outputs[LINE_INFO] = lineInfo;
outputs[SCAN_ERRORS] = errors;
- outputMemento = new ScanDartMemento(content, tokenStream, lineInfo, errors);
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698