OLD | NEW |
---|---|
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
7 | 7 |
8 library engine.ast; | 8 library engine.ast; |
9 | 9 |
10 import 'dart:collection'; | 10 import 'dart:collection'; |
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1605 cloneNode(node.name), cloneToken(node.extendsKeyword), | 1605 cloneNode(node.name), cloneToken(node.extendsKeyword), |
1606 cloneNode(node.bound)); | 1606 cloneNode(node.bound)); |
1607 | 1607 |
1608 @override | 1608 @override |
1609 TypeParameterList visitTypeParameterList(TypeParameterList node) => | 1609 TypeParameterList visitTypeParameterList(TypeParameterList node) => |
1610 new TypeParameterList(cloneToken(node.leftBracket), | 1610 new TypeParameterList(cloneToken(node.leftBracket), |
1611 cloneNodeList(node.typeParameters), cloneToken(node.rightBracket)); | 1611 cloneNodeList(node.typeParameters), cloneToken(node.rightBracket)); |
1612 | 1612 |
1613 @override | 1613 @override |
1614 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => | 1614 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => |
1615 new VariableDeclaration(null, cloneNodeList(node.metadata), | 1615 new VariableDeclaration(cloneNode(node.name), cloneToken(node.equals), |
1616 cloneNode(node.name), cloneToken(node.equals), | |
1617 cloneNode(node.initializer)); | 1616 cloneNode(node.initializer)); |
1618 | 1617 |
1619 @override | 1618 @override |
1620 VariableDeclarationList visitVariableDeclarationList( | 1619 VariableDeclarationList visitVariableDeclarationList( |
1621 VariableDeclarationList node) => new VariableDeclarationList(null, | 1620 VariableDeclarationList node) => new VariableDeclarationList(null, |
1622 cloneNodeList(node.metadata), cloneToken(node.keyword), | 1621 cloneNodeList(node.metadata), cloneToken(node.keyword), |
1623 cloneNode(node.type), cloneNodeList(node.variables)); | 1622 cloneNode(node.type), cloneNodeList(node.variables)); |
1624 | 1623 |
1625 @override | 1624 @override |
1626 VariableDeclarationStatement visitVariableDeclarationStatement( | 1625 VariableDeclarationStatement visitVariableDeclarationStatement( |
(...skipping 8543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10170 _cloneNode(node.name), _mapToken(node.extendsKeyword), | 10169 _cloneNode(node.name), _mapToken(node.extendsKeyword), |
10171 _cloneNode(node.bound)); | 10170 _cloneNode(node.bound)); |
10172 | 10171 |
10173 @override | 10172 @override |
10174 TypeParameterList visitTypeParameterList(TypeParameterList node) => | 10173 TypeParameterList visitTypeParameterList(TypeParameterList node) => |
10175 new TypeParameterList(_mapToken(node.leftBracket), | 10174 new TypeParameterList(_mapToken(node.leftBracket), |
10176 _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket)); | 10175 _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket)); |
10177 | 10176 |
10178 @override | 10177 @override |
10179 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => | 10178 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => |
10180 new VariableDeclaration(null, _cloneNodeList(node.metadata), | 10179 new VariableDeclaration(_cloneNode(node.name), _mapToken(node.equals), |
10181 _cloneNode(node.name), _mapToken(node.equals), | |
10182 _cloneNode(node.initializer)); | 10180 _cloneNode(node.initializer)); |
10183 | 10181 |
10184 @override | 10182 @override |
10185 VariableDeclarationList visitVariableDeclarationList( | 10183 VariableDeclarationList visitVariableDeclarationList( |
10186 VariableDeclarationList node) => new VariableDeclarationList(null, | 10184 VariableDeclarationList node) => new VariableDeclarationList(null, |
10187 _cloneNodeList(node.metadata), _mapToken(node.keyword), | 10185 _cloneNodeList(node.metadata), _mapToken(node.keyword), |
10188 _cloneNode(node.type), _cloneNodeList(node.variables)); | 10186 _cloneNode(node.type), _cloneNodeList(node.variables)); |
10189 | 10187 |
10190 @override | 10188 @override |
10191 VariableDeclarationStatement visitVariableDeclarationStatement( | 10189 VariableDeclarationStatement visitVariableDeclarationStatement( |
(...skipping 9369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
19561 @override | 19559 @override |
19562 String toString() => name; | 19560 String toString() => name; |
19563 } | 19561 } |
19564 | 19562 |
19565 /** | 19563 /** |
19566 * An identifier that has an initial value associated with it. Instances of this | 19564 * An identifier that has an initial value associated with it. Instances of this |
19567 * class are always children of the class [VariableDeclarationList]. | 19565 * class are always children of the class [VariableDeclarationList]. |
19568 * | 19566 * |
19569 * > variableDeclaration ::= | 19567 * > variableDeclaration ::= |
19570 * > [SimpleIdentifier] ('=' [Expression])? | 19568 * > [SimpleIdentifier] ('=' [Expression])? |
19569 * | |
19570 * TODO(paulberry): a VariableDeclaration can never be associated with a | |
19571 * comment or metadata. Consider changing the class hierarchy so that | |
19572 * [VariableDeclaration] does not extend [Declaration]. | |
Brian Wilkerson
2015/04/14 18:02:36
I don't understand why we would disallow associati
Paul Berry
2015/04/14 18:47:13
To clarify, we aren't disallowing comments, we're
Brian Wilkerson
2015/04/14 19:00:23
Not really. I already understood that. I just don'
| |
19571 */ | 19573 */ |
19572 class VariableDeclaration extends Declaration { | 19574 class VariableDeclaration extends Declaration { |
19573 /** | 19575 /** |
19574 * The name of the variable being declared. | 19576 * The name of the variable being declared. |
19575 */ | 19577 */ |
19576 SimpleIdentifier _name; | 19578 SimpleIdentifier _name; |
19577 | 19579 |
19578 /** | 19580 /** |
19579 * The equal sign separating the variable name from the initial value, or | 19581 * The equal sign separating the variable name from the initial value, or |
19580 * `null` if the initial value was not specified. | 19582 * `null` if the initial value was not specified. |
19581 */ | 19583 */ |
19582 Token equals; | 19584 Token equals; |
19583 | 19585 |
19584 /** | 19586 /** |
19585 * The expression used to compute the initial value for the variable, or | 19587 * The expression used to compute the initial value for the variable, or |
19586 * `null` if the initial value was not specified. | 19588 * `null` if the initial value was not specified. |
19587 */ | 19589 */ |
19588 Expression _initializer; | 19590 Expression _initializer; |
19589 | 19591 |
19590 /** | 19592 /** |
19591 * Initialize a newly created variable declaration. Either or both of the | 19593 * Initialize a newly created variable declaration. The [equals] and |
19592 * [comment] and [metadata] can be `null` if the declaration does not have the | 19594 * [initializer] can be `null` if there is no initializer. |
19593 * corresponding attribute. The [equals] and [initializer] can be `null` if | |
19594 * there is no initializer. | |
19595 */ | 19595 */ |
19596 VariableDeclaration(Comment comment, List<Annotation> metadata, | 19596 VariableDeclaration( |
19597 SimpleIdentifier name, this.equals, Expression initializer) | 19597 SimpleIdentifier name, this.equals, Expression initializer) |
19598 : super(comment, metadata) { | 19598 : super(null, null) { |
19599 _name = _becomeParentOf(name); | 19599 _name = _becomeParentOf(name); |
19600 _initializer = _becomeParentOf(initializer); | 19600 _initializer = _becomeParentOf(initializer); |
19601 } | 19601 } |
19602 | 19602 |
19603 @override | 19603 @override |
19604 Iterable get childEntities => super._childEntities | 19604 Iterable get childEntities => super._childEntities |
19605 ..add(_name) | 19605 ..add(_name) |
19606 ..add(equals) | 19606 ..add(equals) |
19607 ..add(_initializer); | 19607 ..add(_initializer); |
19608 | 19608 |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
20099 } | 20099 } |
20100 | 20100 |
20101 @override | 20101 @override |
20102 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); | 20102 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); |
20103 | 20103 |
20104 @override | 20104 @override |
20105 void visitChildren(AstVisitor visitor) { | 20105 void visitChildren(AstVisitor visitor) { |
20106 _safelyVisitChild(_expression, visitor); | 20106 _safelyVisitChild(_expression, visitor); |
20107 } | 20107 } |
20108 } | 20108 } |
OLD | NEW |