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; |
} |