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

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

Issue 2750503012: Re-land "Add support for metadata on type variables to Fasta parser." (with fixes). (Closed)
Patch Set: 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
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.dart ('k') | pkg/front_end/lib/src/fasta/parser/listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fcc7bd58161686f211e8717a4f3cfe1eee283041..ebf7378957bf44ac85b54810f962a6aac79a5eb6 100644
--- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
+++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
@@ -162,6 +162,17 @@ class AstBuilder extends ScopeListener {
push(ast.methodInvocation(null, null, null, null, arguments));
}
+ void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
Paul Berry 2017/03/15 16:14:52 Note: Konstantin introduced an implementation of t
+ debugEvent("Metadata");
+ ArgumentList arguments = pop();
+ SimpleIdentifier constructorName = popIfNotNull(periodBeforeName);
+ var typeArguments = pop();
+ assert(typeArguments == null); // TODO(paulberry)
+ Identifier name = pop();
+ push(ast.annotation(toAnalyzerToken(beginToken), name,
+ toAnalyzerToken(periodBeforeName), constructorName, arguments));
+ }
+
void handleIdentifier(Token token, IdentifierContext context) {
debugEvent("handleIdentifier");
analyzer.Token analyzerToken = toAnalyzerToken(token);
@@ -1387,9 +1398,8 @@ class AstBuilder extends ScopeListener {
debugEvent("TypeVariable");
TypeAnnotation bound = pop();
SimpleIdentifier name = pop();
- List<Annotation> metadata = null; // TODO(paulberry)
- // TODO(paulberry): capture doc comments. See dartbug.com/28851.
- Comment comment = null;
+ List<Annotation> metadata = pop();
+ Comment comment = pop();
push(ast.typeParameter(
comment, metadata, name, toAnalyzerToken(extendsOrSuper), bound));
}
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.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