Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/tree/nodes.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart b/sdk/lib/_internal/compiler/implementation/tree/nodes.dart |
| index 0db90fda76307a1be08efbf1711a46a9797ef59c..2de766a4ab9b10ec87683fb1ba48f36128c11448 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/tree/nodes.dart |
| @@ -21,6 +21,7 @@ abstract class Visitor<R> { |
| R visitContinueStatement(ContinueStatement node) => visitGotoStatement(node); |
| R visitDoWhile(DoWhile node) => visitLoop(node); |
| R visitEmptyStatement(EmptyStatement node) => visitStatement(node); |
| + R visitEnum(Enum node) => visitNode(node); |
| R visitExport(Export node) => visitLibraryDependency(node); |
| R visitExpression(Expression node) => visitNode(node); |
| R visitExpressionStatement(ExpressionStatement node) => visitStatement(node); |
| @@ -150,6 +151,7 @@ abstract class Node extends TreeElementMixin implements Spannable { |
| ContinueStatement asContinueStatement() => null; |
| DoWhile asDoWhile() => null; |
| EmptyStatement asEmptyStatement() => null; |
| + Enum asEnum() => null; |
| ErrorExpression asErrorExpression() => null; |
| Export asExport() => null; |
| Expression asExpression() => null; |
| @@ -1829,6 +1831,33 @@ class Import extends LibraryDependency { |
| } |
| /** |
| + * An `enum` declaration. |
| + * |
| + * An `enum` defines a number of named constants inside a non-extensible class |
| + */ |
| +class Enum extends Node { |
| + /** The name of the enum class. */ |
| + final Identifier name; |
| + /** The names of the enum constants. */ |
| + final NodeList names; |
| + final Token enumToken; |
| + |
| + Enum(this.enumToken, this.name, this.names); |
| + |
| + Enum asEnum() => this; |
| + |
| + accept(Visitor visitor) => visitor.visitEnum(this); |
| + |
| + visitChcildren(Visitor visitor) { |
|
floitsch
2014/05/12 09:51:11
visitChildren
|
| + name.accept(visitor); |
| + if (names != null) names.accept(visitor); |
| + } |
| + |
| + Token getBeginToken() => enumToken; |
| + Token getEndToken() => names.getEndToken(); |
| +} |
| + |
| +/** |
| * An [:export:] library tag. |
| * |
| * An export tag is dependency on another library where the exported identifiers |