Index: pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart |
diff --git a/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart |
index c2381f685fec5cb1e3daeeb68daccd32bfdb6026..373ccfd41371b09a8ff9ab8362225da3afd68a8f 100644 |
--- a/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart |
+++ b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart |
@@ -139,6 +139,7 @@ class TreePrinter { |
final Token withToken = makeIdToken('with'); |
final Token implementsToken = makeIdToken('implements'); |
final Token typedefToken = makeIdToken('typedef'); |
+ final Token enumToken = makeIdToken('enum'); |
static tree.Identifier makeIdentifier(String name) { |
return new tree.Identifier( |
@@ -1060,6 +1061,8 @@ class TreePrinter { |
tree.Node makeNodeForClassElement(elements.ClassElement cls) { |
if (cls.isMixinApplication) { |
return makeNamedMixinApplication(cls); |
+ } else if (cls.isEnumClass) { |
+ return makeEnum(cls); |
} else { |
return makeClassNode(cls); |
} |
@@ -1181,6 +1184,14 @@ class TreePrinter { |
interfaces, classToken, semicolon); |
} |
+ tree.Enum makeEnum(elements.EnumClassElement cls) { |
+ return new tree.Enum( |
+ enumToken, |
+ makeIdentifier(cls.name), |
+ makeList(',', cls.enumValues.map((e) => makeIdentifier(e.name)), |
+ open: openBrace, close: closeBrace)); |
+ } |
+ |
/// Creates a [tree.ClassNode] node for [cls]. |
tree.ClassNode makeClassNode(elements.ClassElement cls) { |
assert(dart2js.invariant(cls, !cls.isUnnamedMixinApplication, |