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

Unified Diff: pkg/front_end/lib/src/fasta/source/diet_listener.dart

Issue 2938793002: Implement metadata on classes and additional semantic checks. (Closed)
Patch Set: Created 3 years, 6 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/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | pkg/front_end/test/fasta/shaker.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/source/diet_listener.dart
diff --git a/pkg/front_end/lib/src/fasta/source/diet_listener.dart b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
index 0a20f0b834c5ab311242a37cabe8c68a8312029c..ef900d29806d4829d4d0c6f1edb2520bb0564112 100644
--- a/pkg/front_end/lib/src/fasta/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
@@ -406,7 +406,7 @@ class DietListener extends StackListener {
}
StackListener createListener(
- MemberBuilder builder, Scope memberScope, bool isInstanceMember,
+ ModifierBuilder builder, Scope memberScope, bool isInstanceMember,
[Scope formalParameterScope]) {
var listener = new TypeInferenceListener();
InterfaceType thisType;
@@ -458,10 +458,19 @@ class DietListener extends StackListener {
void beginClassBody(Token token) {
debugEvent("beginClassBody");
String name = pop();
- pop(); // Metadata.
+ Token metadata = pop();
assert(currentClass == null);
- currentClass = lookupBuilder(token, null, name);
assert(memberScope == library.scope);
+ Builder classBuilder = lookupBuilder(token, null, name);
+ if (metadata != null) {
+ StackListener listener = createListener(classBuilder, memberScope, false);
+ Parser parser = new Parser(listener);
+ parser.parseMetadataStar(metadata);
+ List metadataConstants = listener.pop();
+ Class cls = classBuilder.target;
+ metadataConstants.forEach(cls.addAnnotation);
+ }
+ currentClass = classBuilder;
memberScope = currentClass.scope;
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | pkg/front_end/test/fasta/shaker.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698