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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 2342733002: Break up another large file (Closed)
Patch Set: fixed floating comment Created 4 years, 3 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/generated/element_resolver.dart ('k') | pkg/analyzer/lib/src/generated/error.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index c3093a22fafbf0119490490698e13a4e82e65018..d4064c462b34f06093e388feead99590aecff7d3 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -10,6 +10,7 @@ import 'dart:collection';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/error/error.dart';
import 'package:analyzer/exception/exception.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/plugin/resolver_provider.dart';
@@ -18,7 +19,6 @@ import 'package:analyzer/src/context/builder.dart' show EmbedderYamlLocator;
import 'package:analyzer/src/context/cache.dart';
import 'package:analyzer/src/context/context.dart';
import 'package:analyzer/src/generated/constant.dart';
-import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/java_core.dart';
import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/resolver.dart';
@@ -35,6 +35,8 @@ import 'package:path/path.dart' as pathos;
import 'package:plugin/manager.dart';
import 'package:plugin/plugin.dart';
+export 'package:analyzer/error/listener.dart' show RecordingErrorListener;
+
/**
* Used by [AnalysisOptions] to allow function bodies to be analyzed in some
* sources but not others.
@@ -2363,66 +2365,6 @@ class PerformanceStatistics {
}
/**
- * An error listener that will record the errors that are reported to it in a
- * way that is appropriate for caching those errors within an analysis context.
- */
-class RecordingErrorListener implements AnalysisErrorListener {
- /**
- * A map of sets containing the errors that were collected, keyed by each
- * source.
- */
- Map<Source, HashSet<AnalysisError>> _errors =
- new HashMap<Source, HashSet<AnalysisError>>();
-
- /**
- * Return the errors collected by the listener.
- */
- List<AnalysisError> get errors {
- int numEntries = _errors.length;
- if (numEntries == 0) {
- return AnalysisError.NO_ERRORS;
- }
- List<AnalysisError> resultList = new List<AnalysisError>();
- for (HashSet<AnalysisError> errors in _errors.values) {
- resultList.addAll(errors);
- }
- return resultList;
- }
-
- /**
- * Add all of the errors recorded by the given [listener] to this listener.
- */
- void addAll(RecordingErrorListener listener) {
- for (AnalysisError error in listener.errors) {
- onError(error);
- }
- }
-
- /**
- * Return the errors collected by the listener for the given [source].
- */
- List<AnalysisError> getErrorsForSource(Source source) {
- HashSet<AnalysisError> errorsForSource = _errors[source];
- if (errorsForSource == null) {
- return AnalysisError.NO_ERRORS;
- } else {
- return new List.from(errorsForSource);
- }
- }
-
- @override
- void onError(AnalysisError error) {
- Source source = error.source;
- HashSet<AnalysisError> errorsForSource = _errors[source];
- if (_errors[source] == null) {
- errorsForSource = new HashSet<AnalysisError>();
- _errors[source] = errorsForSource;
- }
- errorsForSource.add(error);
- }
-}
-
-/**
* An visitor that removes any resolution information from an AST structure when
* used to visit that structure.
*/
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/lib/src/generated/error.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698