| 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 engine.ast; | 5 library engine.ast; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'element.dart'; | 9 import 'element.dart'; |
| 10 import 'engine.dart' show AnalysisEngine; | 10 import 'engine.dart' show AnalysisEngine; |
| (...skipping 6003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6014 | 6014 |
| 6015 @override | 6015 @override |
| 6016 SimpleIdentifier get identifier => _parameter.identifier; | 6016 SimpleIdentifier get identifier => _parameter.identifier; |
| 6017 | 6017 |
| 6018 @override | 6018 @override |
| 6019 bool get isConst => _parameter != null && _parameter.isConst; | 6019 bool get isConst => _parameter != null && _parameter.isConst; |
| 6020 | 6020 |
| 6021 @override | 6021 @override |
| 6022 bool get isFinal => _parameter != null && _parameter.isFinal; | 6022 bool get isFinal => _parameter != null && _parameter.isFinal; |
| 6023 | 6023 |
| 6024 @override |
| 6025 NodeList<Annotation> get metadata => _parameter.metadata; |
| 6026 |
| 6024 /** | 6027 /** |
| 6025 * Return the formal parameter with which the default value is associated. | 6028 * Return the formal parameter with which the default value is associated. |
| 6026 */ | 6029 */ |
| 6027 NormalFormalParameter get parameter => _parameter; | 6030 NormalFormalParameter get parameter => _parameter; |
| 6028 | 6031 |
| 6029 /** | 6032 /** |
| 6030 * Set the formal parameter with which the default value is associated to the | 6033 * Set the formal parameter with which the default value is associated to the |
| 6031 * given [formalParameter]. | 6034 * given [formalParameter]. |
| 6032 */ | 6035 */ |
| 6033 void set parameter(NormalFormalParameter formalParameter) { | 6036 void set parameter(NormalFormalParameter formalParameter) { |
| (...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7518 * Return `true` if this parameter was declared with the 'final' modifier. | 7521 * Return `true` if this parameter was declared with the 'final' modifier. |
| 7519 * Parameters that are declared with the 'const' modifier will return `false` | 7522 * Parameters that are declared with the 'const' modifier will return `false` |
| 7520 * even though they are implicitly final. | 7523 * even though they are implicitly final. |
| 7521 */ | 7524 */ |
| 7522 bool get isFinal; | 7525 bool get isFinal; |
| 7523 | 7526 |
| 7524 /** | 7527 /** |
| 7525 * Return the kind of this parameter. | 7528 * Return the kind of this parameter. |
| 7526 */ | 7529 */ |
| 7527 ParameterKind get kind; | 7530 ParameterKind get kind; |
| 7531 |
| 7532 /** |
| 7533 * Return the annotations associated with this parameter. |
| 7534 */ |
| 7535 NodeList<Annotation> get metadata; |
| 7528 } | 7536 } |
| 7529 | 7537 |
| 7530 /** | 7538 /** |
| 7531 * The formal parameter list of a method declaration, function declaration, or | 7539 * The formal parameter list of a method declaration, function declaration, or |
| 7532 * function type alias. | 7540 * function type alias. |
| 7533 * | 7541 * |
| 7534 * While the grammar requires all optional formal parameters to follow all of | 7542 * While the grammar requires all optional formal parameters to follow all of |
| 7535 * the normal formal parameters and at most one grouping of optional formal | 7543 * the normal formal parameters and at most one grouping of optional formal |
| 7536 * parameters, this class does not enforce those constraints. All parameters are | 7544 * parameters, this class does not enforce those constraints. All parameters are |
| 7537 * flattened into a single list, which can have any or all kinds of parameters | 7545 * flattened into a single list, which can have any or all kinds of parameters |
| (...skipping 6186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13724 | 13732 |
| 13725 @override | 13733 @override |
| 13726 ParameterKind get kind { | 13734 ParameterKind get kind { |
| 13727 AstNode parent = this.parent; | 13735 AstNode parent = this.parent; |
| 13728 if (parent is DefaultFormalParameter) { | 13736 if (parent is DefaultFormalParameter) { |
| 13729 return parent.kind; | 13737 return parent.kind; |
| 13730 } | 13738 } |
| 13731 return ParameterKind.REQUIRED; | 13739 return ParameterKind.REQUIRED; |
| 13732 } | 13740 } |
| 13733 | 13741 |
| 13734 /** | 13742 @override |
| 13735 * Return the annotations associated with this parameter. | |
| 13736 */ | |
| 13737 NodeList<Annotation> get metadata => _metadata; | 13743 NodeList<Annotation> get metadata => _metadata; |
| 13738 | 13744 |
| 13739 /** | 13745 /** |
| 13740 * Set the metadata associated with this node to the given [metadata]. | 13746 * Set the metadata associated with this node to the given [metadata]. |
| 13741 */ | 13747 */ |
| 13742 void set metadata(List<Annotation> metadata) { | 13748 void set metadata(List<Annotation> metadata) { |
| 13743 _metadata.clear(); | 13749 _metadata.clear(); |
| 13744 _metadata.addAll(metadata); | 13750 _metadata.addAll(metadata); |
| 13745 } | 13751 } |
| 13746 | 13752 |
| (...skipping 6447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20194 } | 20200 } |
| 20195 | 20201 |
| 20196 @override | 20202 @override |
| 20197 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); | 20203 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); |
| 20198 | 20204 |
| 20199 @override | 20205 @override |
| 20200 void visitChildren(AstVisitor visitor) { | 20206 void visitChildren(AstVisitor visitor) { |
| 20201 _safelyVisitChild(_expression, visitor); | 20207 _safelyVisitChild(_expression, visitor); |
| 20202 } | 20208 } |
| 20203 } | 20209 } |
| OLD | NEW |