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