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

Side by Side Diff: pkg/analyzer/lib/src/generated/ast.dart

Issue 679923002: Port enums AST changes to Dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/ast_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6199 matching lines...) Expand 10 before | Expand all | Expand 10 after
6210 * Set the name of the constant to the given name. 6210 * Set the name of the constant to the given name.
6211 * 6211 *
6212 * @param name the name of the constant 6212 * @param name the name of the constant
6213 */ 6213 */
6214 void set name(SimpleIdentifier name) { 6214 void set name(SimpleIdentifier name) {
6215 this._name = becomeParentOf(name); 6215 this._name = becomeParentOf(name);
6216 } 6216 }
6217 6217
6218 @override 6218 @override
6219 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; 6219 Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
6220
6221 @override
6222 void visitChildren(AstVisitor visitor) {
6223 super.visitChildren(visitor);
6224 safelyVisitChild(_name, visitor);
6225 }
6220 } 6226 }
6221 6227
6222 /** 6228 /**
6223 * Instances of the class `EnumDeclaration` represent the declaration of an enum eration. 6229 * Instances of the class `EnumDeclaration` represent the declaration of an enum eration.
6224 * 6230 *
6225 * <pre> 6231 * <pre>
6226 * enumType ::= 6232 * enumType ::=
6227 * metadata 'enum' [SimpleIdentifier] '{' [SimpleIdentifier] (',' [SimpleIde ntifier])* (',')? '}' 6233 * metadata 'enum' [SimpleIdentifier] '{' [SimpleIdentifier] (',' [SimpleIde ntifier])* (',')? '}'
6228 * </pre> 6234 * </pre>
6229 */ 6235 */
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
6297 * set the name of the enumeration to the given identifier. 6303 * set the name of the enumeration to the given identifier.
6298 * 6304 *
6299 * @param name the name of the enumeration 6305 * @param name the name of the enumeration
6300 */ 6306 */
6301 void set name(SimpleIdentifier name) { 6307 void set name(SimpleIdentifier name) {
6302 this._name = becomeParentOf(name); 6308 this._name = becomeParentOf(name);
6303 } 6309 }
6304 6310
6305 @override 6311 @override
6306 Token get firstTokenAfterCommentAndMetadata => keyword; 6312 Token get firstTokenAfterCommentAndMetadata => keyword;
6313
6314 @override
6315 void visitChildren(AstVisitor visitor) {
6316 super.visitChildren(visitor);
6317 safelyVisitChild(_name, visitor);
6318 _constants.accept(visitor);
6319 }
6307 } 6320 }
6308 6321
6309 /** 6322 /**
6310 * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier. 6323 * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier.
6311 */ 6324 */
6312 class EphemeralIdentifier extends SimpleIdentifier { 6325 class EphemeralIdentifier extends SimpleIdentifier {
6313 EphemeralIdentifier(AstNode parent, int location) : super(new StringToken(Toke nType.IDENTIFIER, "", location)) { 6326 EphemeralIdentifier(AstNode parent, int location) : super(new StringToken(Toke nType.IDENTIFIER, "", location)) {
6314 parent.becomeParentOf(this); 6327 parent.becomeParentOf(this);
6315 } 6328 }
6316 } 6329 }
(...skipping 9415 matching lines...) Expand 10 before | Expand all | Expand 10 after
15732 15745
15733 /** 15746 /**
15734 * Return `true` if this identifier is the name being declared in a declaratio n. 15747 * Return `true` if this identifier is the name being declared in a declaratio n.
15735 * 15748 *
15736 * @return `true` if this identifier is the name being declared in a declarati on 15749 * @return `true` if this identifier is the name being declared in a declarati on
15737 */ 15750 */
15738 bool inDeclarationContext() { 15751 bool inDeclarationContext() {
15739 AstNode parent = this.parent; 15752 AstNode parent = this.parent;
15740 if (parent is CatchClause) { 15753 if (parent is CatchClause) {
15741 CatchClause clause = parent; 15754 CatchClause clause = parent;
15742 return identical(this, clause.exceptionParameter) || identical(this, claus e.stackTraceParameter); 15755 return identical(this, clause.exceptionParameter) ||
Brian Wilkerson 2014/10/26 18:36:53 nit: Personally, I prefer having the operator on t
scheglov 2014/10/26 21:08:08 https://www.dartlang.org/articles/style-guide/#do-
15756 identical(this, clause.stackTraceParameter);
15743 } else if (parent is ClassDeclaration) { 15757 } else if (parent is ClassDeclaration) {
15744 return identical(this, parent.name); 15758 return identical(this, parent.name);
15745 } else if (parent is ClassTypeAlias) { 15759 } else if (parent is ClassTypeAlias) {
15746 return identical(this, parent.name); 15760 return identical(this, parent.name);
15747 } else if (parent is ConstructorDeclaration) { 15761 } else if (parent is ConstructorDeclaration) {
15748 return identical(this, parent.name); 15762 return identical(this, parent.name);
15749 } else if (parent is DeclaredIdentifier) { 15763 } else if (parent is DeclaredIdentifier) {
15750 return identical(this, parent.identifier); 15764 return identical(this, parent.identifier);
15765 } else if (parent is EnumDeclaration) {
15766 return identical(this, parent.name);
15767 } else if (parent is EnumConstantDeclaration) {
15768 return identical(this, parent.name);
15751 } else if (parent is FunctionDeclaration) { 15769 } else if (parent is FunctionDeclaration) {
15752 return identical(this, parent.name); 15770 return identical(this, parent.name);
15753 } else if (parent is FunctionTypeAlias) { 15771 } else if (parent is FunctionTypeAlias) {
15754 return identical(this, parent.name); 15772 return identical(this, parent.name);
15755 } else if (parent is ImportDirective) { 15773 } else if (parent is ImportDirective) {
15756 return identical(this, parent.prefix); 15774 return identical(this, parent.prefix);
15757 } else if (parent is Label) { 15775 } else if (parent is Label) {
15758 return identical(this, parent.label) && (parent.parent is LabeledStatement ); 15776 return identical(this, parent.label) && (parent.parent is LabeledStatement );
15759 } else if (parent is MethodDeclaration) { 15777 } else if (parent is MethodDeclaration) {
15760 return identical(this, parent.name); 15778 return identical(this, parent.name);
(...skipping 3947 matching lines...) Expand 10 before | Expand all | Expand 10 after
19708 _elements[index] = node; 19726 _elements[index] = node;
19709 } 19727 }
19710 void clear() { 19728 void clear() {
19711 _elements = <E> []; 19729 _elements = <E> [];
19712 } 19730 }
19713 int get length => _elements.length; 19731 int get length => _elements.length;
19714 void set length(int value) { 19732 void set length(int value) {
19715 throw new UnsupportedError("Cannot resize NodeList."); 19733 throw new UnsupportedError("Cannot resize NodeList.");
19716 } 19734 }
19717 } 19735 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698