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

Unified Diff: pkg/front_end/lib/src/fasta/parser/listener.dart

Issue 2699423002: Implement AstBuilder support for top level variables and function literals. (Closed)
Patch Set: Comment changes Created 3 years, 10 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/front_end/lib/src/fasta/analyzer/ast_builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 897a754608819c9a83e200cb0d84845179b09326..ecd6b7368d7c597d66c45ffe669926ea89325099 100644
--- a/pkg/front_end/lib/src/fasta/parser/listener.dart
+++ b/pkg/front_end/lib/src/fasta/parser/listener.dart
@@ -342,10 +342,13 @@ class Listener {
void beginFieldInitializer(Token token) {}
+ /// Handle the end of a field initializer. Substructures:
+ /// - Initializer expression
void endFieldInitializer(Token assignment) {
logEvent("FieldInitializer");
}
+ /// Handle the lack of a field initializer.
void handleNoFieldInitializer(Token token) {
logEvent("NoFieldInitializer");
}
@@ -549,6 +552,13 @@ class Listener {
void beginTopLevelMember(Token token) {}
+ /// Handle the end of a top level variable declaration. Substructures:
+ /// - Metadata
+ /// - Modifiers
+ /// - Type
+ /// - Repeated [count] times:
+ /// - Variable name (identifier)
+ /// - Field initializer
scheglov 2017/02/20 20:10:36 Seems inconsistent. Maybe variable in both or fiel
ahe 2017/02/21 09:10:24 I think it would make sense to go go through this
/// Doesn't have a corresponding begin event, use [beginTopLevelMember]
/// instead.
void endTopLevelFields(int count, Token beginToken, Token endToken) {
@@ -622,6 +632,12 @@ class Listener {
void beginUnnamedFunction(Token token) {}
+ /// Handle the end of a function expression (e.g. "() { ... }").
+ /// Substructures:
+ /// - Type variables
+ /// - Formal parameters
+ /// - Async marker
+ /// - Body
void endUnnamedFunction(Token token) {
logEvent("UnnamedFunction");
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698