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

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

Issue 2714843002: Add NormalFormalParameter.covariantKeyword setter and factory parameter. (Closed)
Patch Set: Created 3 years, 10 months 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
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 library analyzer.src.dart.ast.ast; 5 library analyzer.src.dart.ast.ast;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/syntactic_entity.dart'; 10 import 'package:analyzer/dart/ast/syntactic_entity.dart';
(...skipping 4439 matching lines...) Expand 10 before | Expand all | Expand 10 after
4450 * [comment] and [metadata] can be `null` if the parameter does not have the 4450 * [comment] and [metadata] can be `null` if the parameter does not have the
4451 * corresponding attribute. The [keyword] can be `null` if there is a type. 4451 * corresponding attribute. The [keyword] can be `null` if there is a type.
4452 * The [type] must be `null` if the keyword is 'var'. The [thisKeyword] and 4452 * The [type] must be `null` if the keyword is 'var'. The [thisKeyword] and
4453 * [period] can be `null` if the keyword 'this' was not provided. The 4453 * [period] can be `null` if the keyword 'this' was not provided. The
4454 * [parameters] can be `null` if this is not a function-typed field formal 4454 * [parameters] can be `null` if this is not a function-typed field formal
4455 * parameter. 4455 * parameter.
4456 */ 4456 */
4457 FieldFormalParameterImpl( 4457 FieldFormalParameterImpl(
4458 CommentImpl comment, 4458 CommentImpl comment,
4459 List<Annotation> metadata, 4459 List<Annotation> metadata,
4460 Token covariantKeyword,
4460 this.keyword, 4461 this.keyword,
4461 TypeAnnotationImpl type, 4462 TypeAnnotationImpl type,
4462 this.thisKeyword, 4463 this.thisKeyword,
4463 this.period, 4464 this.period,
4464 SimpleIdentifierImpl identifier, 4465 SimpleIdentifierImpl identifier,
4465 TypeParameterListImpl typeParameters, 4466 TypeParameterListImpl typeParameters,
4466 FormalParameterListImpl parameters) 4467 FormalParameterListImpl parameters)
4467 : super(comment, metadata, identifier) { 4468 : super(comment, metadata, covariantKeyword, identifier) {
4468 _type = _becomeParentOf(type); 4469 _type = _becomeParentOf(type);
4469 _typeParameters = _becomeParentOf(typeParameters); 4470 _typeParameters = _becomeParentOf(typeParameters);
4470 _parameters = _becomeParentOf(parameters); 4471 _parameters = _becomeParentOf(parameters);
4471 } 4472 }
4472 4473
4473 @override 4474 @override
4474 Token get beginToken { 4475 Token get beginToken {
4475 NodeList<Annotation> metadata = this.metadata; 4476 NodeList<Annotation> metadata = this.metadata;
4476 if (!metadata.isEmpty) { 4477 if (!metadata.isEmpty) {
4477 return metadata.beginToken; 4478 return metadata.beginToken;
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
5567 5568
5568 /** 5569 /**
5569 * Initialize a newly created formal parameter. Either or both of the 5570 * Initialize a newly created formal parameter. Either or both of the
5570 * [comment] and [metadata] can be `null` if the parameter does not have the 5571 * [comment] and [metadata] can be `null` if the parameter does not have the
5571 * corresponding attribute. The [returnType] can be `null` if no return type 5572 * corresponding attribute. The [returnType] can be `null` if no return type
5572 * was specified. 5573 * was specified.
5573 */ 5574 */
5574 FunctionTypedFormalParameterImpl( 5575 FunctionTypedFormalParameterImpl(
5575 CommentImpl comment, 5576 CommentImpl comment,
5576 List<Annotation> metadata, 5577 List<Annotation> metadata,
5578 Token covariantKeyword,
5577 TypeAnnotationImpl returnType, 5579 TypeAnnotationImpl returnType,
5578 SimpleIdentifierImpl identifier, 5580 SimpleIdentifierImpl identifier,
5579 TypeParameterListImpl typeParameters, 5581 TypeParameterListImpl typeParameters,
5580 FormalParameterListImpl parameters, 5582 FormalParameterListImpl parameters,
5581 this.question) 5583 this.question)
5582 : super(comment, metadata, identifier) { 5584 : super(comment, metadata, covariantKeyword, identifier) {
5583 _returnType = _becomeParentOf(returnType); 5585 _returnType = _becomeParentOf(returnType);
5584 _typeParameters = _becomeParentOf(typeParameters); 5586 _typeParameters = _becomeParentOf(typeParameters);
5585 _parameters = _becomeParentOf(parameters); 5587 _parameters = _becomeParentOf(parameters);
5586 } 5588 }
5587 5589
5588 @override 5590 @override
5589 Token get beginToken { 5591 Token get beginToken {
5590 NodeList<Annotation> metadata = this.metadata; 5592 NodeList<Annotation> metadata = this.metadata;
5591 if (!metadata.isEmpty) { 5593 if (!metadata.isEmpty) {
5592 return metadata.beginToken; 5594 return metadata.beginToken;
(...skipping 2538 matching lines...) Expand 10 before | Expand all | Expand 10 after
8131 * The name of the parameter being declared. 8133 * The name of the parameter being declared.
8132 */ 8134 */
8133 SimpleIdentifier _identifier; 8135 SimpleIdentifier _identifier;
8134 8136
8135 /** 8137 /**
8136 * Initialize a newly created formal parameter. Either or both of the 8138 * Initialize a newly created formal parameter. Either or both of the
8137 * [comment] and [metadata] can be `null` if the parameter does not have the 8139 * [comment] and [metadata] can be `null` if the parameter does not have the
8138 * corresponding attribute. 8140 * corresponding attribute.
8139 */ 8141 */
8140 NormalFormalParameterImpl(CommentImpl comment, List<Annotation> metadata, 8142 NormalFormalParameterImpl(CommentImpl comment, List<Annotation> metadata,
8141 SimpleIdentifierImpl identifier) { 8143 this.covariantKeyword, SimpleIdentifierImpl identifier) {
8142 _comment = _becomeParentOf(comment); 8144 _comment = _becomeParentOf(comment);
8143 _metadata = new NodeListImpl<Annotation>(this, metadata); 8145 _metadata = new NodeListImpl<Annotation>(this, metadata);
8144 _identifier = _becomeParentOf(identifier); 8146 _identifier = _becomeParentOf(identifier);
8145 } 8147 }
8146 8148
8147 @override 8149 @override
8148 Comment get documentationComment => _comment; 8150 Comment get documentationComment => _comment;
8149 8151
8150 @override 8152 @override
8151 void set documentationComment(Comment comment) { 8153 void set documentationComment(Comment comment) {
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
9230 * does not have a declared type. 9232 * does not have a declared type.
9231 */ 9233 */
9232 TypeAnnotation _type; 9234 TypeAnnotation _type;
9233 9235
9234 /** 9236 /**
9235 * Initialize a newly created formal parameter. Either or both of the 9237 * Initialize a newly created formal parameter. Either or both of the
9236 * [comment] and [metadata] can be `null` if the parameter does not have the 9238 * [comment] and [metadata] can be `null` if the parameter does not have the
9237 * corresponding attribute. The [keyword] can be `null` if a type was 9239 * corresponding attribute. The [keyword] can be `null` if a type was
9238 * specified. The [type] must be `null` if the keyword is 'var'. 9240 * specified. The [type] must be `null` if the keyword is 'var'.
9239 */ 9241 */
9240 SimpleFormalParameterImpl(CommentImpl comment, List<Annotation> metadata, 9242 SimpleFormalParameterImpl(
9241 this.keyword, TypeAnnotationImpl type, SimpleIdentifierImpl identifier) 9243 CommentImpl comment,
9242 : super(comment, metadata, identifier) { 9244 List<Annotation> metadata,
9245 Token covariantKeyword,
9246 this.keyword,
9247 TypeAnnotationImpl type,
9248 SimpleIdentifierImpl identifier)
9249 : super(comment, metadata, covariantKeyword, identifier) {
9243 _type = _becomeParentOf(type); 9250 _type = _becomeParentOf(type);
9244 } 9251 }
9245 9252
9246 @override 9253 @override
9247 Token get beginToken { 9254 Token get beginToken {
9248 NodeList<Annotation> metadata = this.metadata; 9255 NodeList<Annotation> metadata = this.metadata;
9249 if (!metadata.isEmpty) { 9256 if (!metadata.isEmpty) {
9250 return metadata.beginToken; 9257 return metadata.beginToken;
9251 } else if (covariantKeyword != null) { 9258 } else if (covariantKeyword != null) {
9252 return covariantKeyword; 9259 return covariantKeyword;
(...skipping 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after
11468 11475
11469 @override 11476 @override
11470 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => 11477 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) =>
11471 visitor.visitYieldStatement(this); 11478 visitor.visitYieldStatement(this);
11472 11479
11473 @override 11480 @override
11474 void visitChildren(AstVisitor visitor) { 11481 void visitChildren(AstVisitor visitor) {
11475 _expression?.accept(visitor); 11482 _expression?.accept(visitor);
11476 } 11483 }
11477 } 11484 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698