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

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

Issue 2748763003: Add support for parsing annotations with Fasta. (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/analyzer/test/generated/parser_test.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/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 26196a8e8ccaebc76ea18f689182f0d13e728c0a..f56e5b78c4228104684e63b43c0f566c59241484 100644
--- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
+++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
@@ -1470,6 +1470,21 @@ class AstBuilder extends ScopeListener {
}
}
+ @override
+ void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
+ debugEvent("Metadata");
+ MethodInvocation invocation = pop();
+ SimpleIdentifier constructorName = periodBeforeName != null ? pop() : null;
+ pop(); // Type arguments, not allowed.
+ Identifier name = pop();
+ push(ast.annotation(
+ toAnalyzerToken(beginToken),
+ name,
+ toAnalyzerToken(periodBeforeName),
+ constructorName,
+ invocation?.argumentList));
+ }
+
ParameterKind _toAnalyzerParameterKind(FormalParameterType type) {
if (type == FormalParameterType.POSITIONAL) {
return ParameterKind.POSITIONAL;
« no previous file with comments | « pkg/analyzer/test/generated/parser_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698