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

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

Issue 2747853002: Rename xFunctionBody to xBlockFunctionBody. Document related listener methods. (Closed)
Patch Set: Rename to handleEmptyFunctionBody() and handleExpressionFunctionBody(). Created 3 years, 9 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 cb167d722ba49201efe2176777e9afa6629d04df..27157e8d8d24706bb14c927311e1d8f75165bf7a 100644
--- a/pkg/front_end/lib/src/fasta/parser/listener.dart
+++ b/pkg/front_end/lib/src/fasta/parser/listener.dart
@@ -241,10 +241,20 @@ class Listener {
logEvent("FunctionDeclaration");
}
- void beginFunctionBody(Token token) {}
-
- void endFunctionBody(int count, Token beginToken, Token endToken) {
- logEvent("FunctionBody");
+ /// This method is invoked when the parser sees that a function has a
+ /// block function body. This method is not invoked for empty or expression
+ /// function bodies, see the corresponding methods [handleEmptyFunctionBody]
+ /// and [handleExpressionFunctionBody].
+ void beginBlockFunctionBody(Token token) {}
+
+ /// This method is invoked by the parser after it finished parsing a block
+ /// function body. This method is not invoked for empty or expression
+ /// function bodies, see the corresponding methods [handleEmptyFunctionBody]
+ /// and [handleExpressionFunctionBody]. The [beginToken] is the '{' token,
+ /// and the [endToken] is the '}' token of the block. The number of
+ /// statements is given as the [count] parameter.
+ void endBlockFunctionBody(int count, Token beginToken, Token endToken) {
+ logEvent("BlockFunctionBody");
}
void handleNoFunctionBody(Token token) {
@@ -564,11 +574,14 @@ class Listener {
void beginReturnStatement(Token token) {}
- void endEmptyFunctionBody(Token semicolon) {
+ /// This method is invoked when a function has the empty body.
+ void handleEmptyFunctionBody(Token semicolon) {
logEvent("EmptyFunctionBody");
}
- void endExpressionFunctionBody(Token arrowToken, Token endToken) {
+ /// This method is invoked when parser finishes parsing the corresponding
+ /// expression of the expression function body.
+ void handleExpressionFunctionBody(Token arrowToken, Token endToken) {
logEvent("ExpressionFunctionBody");
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | pkg/front_end/lib/src/fasta/parser/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698