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

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

Issue 1418973002: Error reporting for spans. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
Index: pkg/analyzer/lib/src/generated/error.dart
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index 6b4d93efa9fd29bb73c54fd50c96a0b787efdb32..19b4409889b9972c7fa153f5df5b833f17718c04 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -6,6 +6,8 @@ library engine.error;
import 'dart:collection';
+import 'package:source_span/source_span.dart';
+
import 'ast.dart' show AstNode;
import 'element.dart';
import 'java_core.dart';
@@ -2663,6 +2665,16 @@ class ErrorReporter {
}
/**
+ * Report an error with the given [errorCode] and [arguments]. The location of
+ * the error is specified by the given [span].
+ */
+ void reportErrorForSpan(ErrorCode errorCode, SourceSpan span,
+ [List<Object> arguments]) {
+ _errorListener.onError(new AnalysisError(
+ _source, span.start.offset, span.length, errorCode, arguments));
scheglov 2015/10/21 23:47:21 I'd use reportErrorForOffset() as other reportErro
pquitslund 2015/10/21 23:56:57 Done.
+ }
+
+ /**
* Report an error with the given [errorCode] and [arguments]. The [token] is
* used to compute the location of the error.
*/
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698