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

Unified Diff: pkg/compiler/lib/src/parser/node_listener.dart

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. 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
« no previous file with comments | « pkg/compiler/lib/src/parser/member_listener.dart ('k') | pkg/compiler/lib/src/parser/parser_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/parser/node_listener.dart
diff --git a/pkg/compiler/lib/src/parser/node_listener.dart b/pkg/compiler/lib/src/parser/node_listener.dart
index d079b70c08c4ad11cadb00a85165d81e30075f62..1344c5dc73b6814ae1c7db4987033f18155ef4ba 100644
--- a/pkg/compiler/lib/src/parser/node_listener.dart
+++ b/pkg/compiler/lib/src/parser/node_listener.dart
@@ -31,9 +31,9 @@ import 'partial_elements.dart' show
class NodeListener extends ElementListener {
NodeListener(
- DiagnosticListener listener,
+ DiagnosticReporter reporter,
CompilationUnitElement element)
- : super(listener, element, null);
+ : super(reporter, element, null);
void addLibraryTag(LibraryTag tag) {
pushNode(tag);
@@ -199,7 +199,7 @@ class NodeListener extends ElementListener {
}
void handleOnError(Token token, var errorInformation) {
- listener.internalError(token, "'${token.value}': ${errorInformation}");
+ reporter.internalError(token, "'${token.value}': ${errorInformation}");
}
Token expectedFunctionBody(Token token) {
@@ -270,13 +270,13 @@ class NodeListener extends ElementListener {
pushNode(new Send(receiver, new Operator(token), arguments));
}
if (identical(tokenString, '===')) {
- listener.reportErrorMessage(
+ reporter.reportErrorMessage(
token,
MessageKind.UNSUPPORTED_EQ_EQ_EQ,
{'lhs': receiver, 'rhs': argument});
}
if (identical(tokenString, '!==')) {
- listener.reportErrorMessage(
+ reporter.reportErrorMessage(
token,
MessageKind.UNSUPPORTED_BANG_EQ_EQ,
{'lhs': receiver, 'rhs': argument});
@@ -451,7 +451,7 @@ class NodeListener extends ElementListener {
void endRethrowStatement(Token throwToken, Token endToken) {
pushNode(new Rethrow(throwToken, endToken));
if (identical(throwToken.stringValue, 'throw')) {
- listener.reportErrorMessage(
+ reporter.reportErrorMessage(
throwToken, MessageKind.UNSUPPORTED_THROW_WITHOUT_EXP);
}
}
@@ -814,11 +814,11 @@ class NodeListener extends ElementListener {
}
void log(message) {
- listener.log(message);
+ reporter.log(message);
}
void internalError({Token token, Node node}) {
- // TODO(ahe): This should call listener.internalError.
+ // TODO(ahe): This should call reporter.internalError.
Spannable spannable = (token == null) ? node : token;
throw new SpannableAssertionFailure(spannable, 'Internal error in parser.');
}
« no previous file with comments | « pkg/compiler/lib/src/parser/member_listener.dart ('k') | pkg/compiler/lib/src/parser/parser_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698