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

Unified Diff: pkg/fasta/lib/src/source/stack_listener.dart

Issue 2650803002: Rename events. (Closed)
Patch Set: Address review comments. Created 3 years, 11 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/fasta/lib/src/source/scope_listener.dart ('k') | pkg/fasta/lib/src/source/unhandled_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fasta/lib/src/source/stack_listener.dart
diff --git a/pkg/fasta/lib/src/source/stack_listener.dart b/pkg/fasta/lib/src/source/stack_listener.dart
index dce8ae19c89ab5b2cc5250755871becedc09a3fc..8676854eac6398b22e6526110f659e028aa60a8d 100644
--- a/pkg/fasta/lib/src/source/stack_listener.dart
+++ b/pkg/fasta/lib/src/source/stack_listener.dart
@@ -7,10 +7,10 @@ library fasta.stack_listener;
import 'dart:collection' show
Queue;
-import 'package:dart_parser/src/listener.dart' show
+import 'package:dart_parser/dart_parser.dart' show
Listener;
-import 'package:dart_scanner/src/token.dart' show
+import 'package:dart_scanner/dart_scanner.dart' show
BeginGroupToken,
Token;
@@ -109,18 +109,21 @@ abstract class StackListener extends Listener {
print(name);
}
+ @override
void logEvent(String name) {
print(" ${stack.join('\n ')}");
internalError("Unhandled event: $name in $runtimeType $uri.");
}
+ @override
void handleIdentifier(Token token) {
debugEvent("handleIdentifier");
push(token.value);
}
- void endConstructorInitializer(Token token) {
- debugEvent("ConstructorInitializer");
+ @override
+ void endInitializer(Token token) {
+ debugEvent("Initializer");
}
void checkEmpty() {
@@ -135,60 +138,72 @@ abstract class StackListener extends Listener {
}
}
+ @override
void endTopLevelDeclaration(Token token) {
debugEvent("TopLevelDeclaration");
checkEmpty();
}
+ @override
void endCompilationUnit(int count, Token token) {
debugEvent("CompilationUnit");
checkEmpty();
}
+ @override
void handleNoTypeArguments(Token token) {
debugEvent("NoTypeArguments");
push(NullValue.TypeArguments);
}
+ @override
void handleNoTypeVariables(Token token) {
debugEvent("NoTypeVariables");
push(NullValue.TypeVariables);
}
+ @override
void handleNoType(Token token) {
debugEvent("NoType");
push(NullValue.Type);
}
+ @override
void handleNoFormalParameters(Token token) {
debugEvent("NoFormalParameters");
push(NullValue.FormalParameters);
}
+ @override
void handleNoArguments(Token token) {
debugEvent("NoArguments");
push(NullValue.Arguments);
}
+ @override
void handleNoFunctionBody(Token token) {
debugEvent("NoFunctionBody");
push(NullValue.FunctionBody);
}
+ @override
void handleNoInitializers() {
debugEvent("NoInitializers");
push(NullValue.Initializers);
}
+ @override
void handleParenthesizedExpression(BeginGroupToken token) {
debugEvent("ParenthesizedExpression");
}
+ @override
void beginLiteralString(Token token) {
debugEvent("beginLiteralString");
push(token);
}
+ @override
void endLiteralString(int interpolationCount) {
debugEvent("endLiteralString");
if (interpolationCount == 0) {
@@ -199,15 +214,18 @@ abstract class StackListener extends Listener {
}
}
+ @override
void handleStringJuxtaposition(int literalCount) {
debugEvent("StringJuxtaposition");
push(popList(literalCount).join(""));
}
+ @override
void endCatchClause(Token token) {
debugEvent("CatchClause");
}
+ @override
void error(String message, Token token) {
inputError(uri, token.charOffset, message);
}
« no previous file with comments | « pkg/fasta/lib/src/source/scope_listener.dart ('k') | pkg/fasta/lib/src/source/unhandled_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698