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

Unified Diff: pkg/front_end/lib/src/fasta/parser/listener.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/front_end/lib/src/fasta/parser/listener.dart
diff --git a/pkg/front_end/lib/src/fasta/parser/listener.dart b/pkg/front_end/lib/src/fasta/parser/listener.dart
index db6e902d7676535d36ad6c7ecad93be60d3d20f7..4629fcbd18d1ef0f0c79ab5cccea142ea50f56b3 100644
--- a/pkg/front_end/lib/src/fasta/parser/listener.dart
+++ b/pkg/front_end/lib/src/fasta/parser/listener.dart
@@ -704,6 +704,18 @@ class Listener {
logEvent("TopLevelDeclaration");
}
+ /// Called by the [Parser] when it recovers from an invalid top level
+ /// declaration, where [beginToken] is the first token in the declaration
+ /// and [endToken] is the last. This is called after the begin/end
+ /// metadata star events, and instead of [endTopLevelDeclaration]
+ /// and any of the events listed in [endTopLevelDeclaration].
+ ///
+ /// Substructures:
+ /// - metadata
+ void handleInvalidTopLevelDeclaration(Token beginToken, Token endToken) {
+ logEvent("InvalidTopLevelDeclaration");
+ }
+
/// Marks the beginning of a top level field or method declaration.
/// Doesn't have a corresponding end event.
/// See [endTopLevelFields] and [endTopLevelMethod].

Powered by Google App Engine
This is Rietveld 408576698