| 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 8ad5b49d2e1525dd9f865f298525e34780da6a3f..e054dcc7986e192a04dc89f0c4fb4b6feaa42c5a 100644
|
| --- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
|
| +++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
|
| @@ -1481,12 +1481,13 @@ class AstBuilder extends ScopeListener {
|
| comment, metadata, partKeyword, ofKeyword, uri, name, semicolon));
|
| }
|
|
|
| - void endUnnamedFunction(Token beginToken, Token token) {
|
| + @override
|
| + void endFunctionExpression(Token beginToken, Token token) {
|
| // TODO(paulberry): set up scopes properly to resolve parameters and type
|
| // variables. Note that this is tricky due to the handling of initializers
|
| // in constructors, so the logic should be shared with BodyBuilder as much
|
| // as possible.
|
| - debugEvent("UnnamedFunction");
|
| + debugEvent("FunctionExpression");
|
| FunctionBody body = pop();
|
| FormalParameterList parameters = pop();
|
| TypeParameterList typeParameters = pop();
|
| @@ -1564,21 +1565,20 @@ class AstBuilder extends ScopeListener {
|
| }
|
|
|
| @override
|
| - void endFunction(Token getOrSet, Token endToken) {
|
| - debugEvent("Function");
|
| + void endNamedFunctionExpression(Token endToken) {
|
| + logEvent("NamedFunctionExpression");
|
| + }
|
| +
|
| + @override
|
| + void endFunctionDeclaration(Token endToken) {
|
| + debugEvent("FunctionDeclaration");
|
| FunctionBody body = pop();
|
| pop(); // constructor initializers
|
| pop(); // separator before constructor initializers
|
| FormalParameterList parameters = pop();
|
| TypeParameterList typeParameters = pop();
|
| - // TODO(scheglov) It is an error if "getOrSet" is not null.
|
| - push(ast.functionExpression(typeParameters, parameters, body));
|
| - }
|
| -
|
| - @override
|
| - void endFunctionDeclaration(Token token) {
|
| - debugEvent("FunctionDeclaration");
|
| - FunctionExpression functionExpression = pop();
|
| + FunctionExpression functionExpression =
|
| + ast.functionExpression(typeParameters, parameters, body);
|
| SimpleIdentifier name = pop();
|
| TypeAnnotation returnType = pop();
|
| pop(); // modifiers
|
|
|