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

Unified Diff: pkg/analyzer/lib/src/fasta/ast_builder.dart

Issue 2985703002: new handleInvalidTopLevelDeclaration event in fasta parser (Closed)
Patch Set: cleanup forwarding listener - enclosingEvent Created 3 years, 4 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/fasta/ast_builder.dart
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 7c3bf9ef2ef70ad80e32c90c915515a95e1a0cd7..1639a3ea8253d51004ecbdf207950d4ab203a407 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -1124,6 +1124,15 @@ class AstBuilder extends ScopeListener {
}
@override
+ void handleInvalidTopLevelDeclaration(Token beginToken, Token endToken) {
+ // TODO(danrubel): consider creating a AST node
+ // representing the invalid declaration
+ // to support code completion, quick fixes, etc.
+ super.handleInvalidTopLevelDeclaration(beginToken, endToken);
+ pop(); // comment
+ }
+
+ @override
void beginCompilationUnit(Token token) {
push(token);
}

Powered by Google App Engine
This is Rietveld 408576698