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

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

Issue 2703393005: Implement FunctionTypeAlias in AstBuilder. (Closed)
Patch Set: Reformat 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
Index: pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
index 08f97bf726f49472f268fcda4b930791447a1652..5e9603f95a2ab007f6baf4c911d04bb776198cd0 100644
--- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
+++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
@@ -1076,6 +1076,27 @@ class AstBuilder extends ScopeListener {
handleNoTypeArguments(token);
endType(token, token);
}
+
+ @override
+ void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
+ debugEvent("FunctionTypeAlias");
+ FormalParameterList parameters = pop();
+ TypeParameterList typeParameters = pop();
+ SimpleIdentifier name = pop();
+ TypeAnnotation returnType = pop();
+ List<Annotation> metadata = pop();
+ // TODO(paulberry): capture doc comments.
+ Comment comment = null;
+ push(ast.functionTypeAlias(
+ comment,
+ metadata,
+ toAnalyzerToken(typedefKeyword),
+ returnType,
+ name,
+ typeParameters,
+ parameters,
+ toAnalyzerToken(endToken)));
+ }
}
/// Data structure placed on the stack to represent a class body.
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | pkg/front_end/lib/src/fasta/parser/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698