| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 * Return the first token following the comment and metadata. | 133 * Return the first token following the comment and metadata. |
| 134 */ | 134 */ |
| 135 Token get firstTokenAfterCommentAndMetadata; | 135 Token get firstTokenAfterCommentAndMetadata; |
| 136 | 136 |
| 137 /** | 137 /** |
| 138 * Return the annotations associated with this node. | 138 * Return the annotations associated with this node. |
| 139 */ | 139 */ |
| 140 NodeList<Annotation> get metadata => _metadata; | 140 NodeList<Annotation> get metadata => _metadata; |
| 141 | 141 |
| 142 /** | 142 /** |
| 143 * Set the metadata associated with this node to the given [metadata]. | |
| 144 */ | |
| 145 @deprecated // Directly modify the list returned by "this.metadata" | |
| 146 void set metadata(List<Annotation> metadata) { | |
| 147 _metadata.clear(); | |
| 148 _metadata.addAll(metadata); | |
| 149 } | |
| 150 | |
| 151 /** | |
| 152 * Return a list containing the comment and annotations associated with this | 143 * Return a list containing the comment and annotations associated with this |
| 153 * node, sorted in lexical order. | 144 * node, sorted in lexical order. |
| 154 */ | 145 */ |
| 155 List<AstNode> get sortedCommentAndAnnotations { | 146 List<AstNode> get sortedCommentAndAnnotations { |
| 156 return <AstNode>[] | 147 return <AstNode>[] |
| 157 ..add(_comment) | 148 ..add(_comment) |
| 158 ..addAll(_metadata) | 149 ..addAll(_metadata) |
| 159 ..sort(AstNode.LEXICAL_ORDER); | 150 ..sort(AstNode.LEXICAL_ORDER); |
| 160 } | 151 } |
| 161 | 152 |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 449 } |
| 459 _correspondingStaticParameters = parameters; | 450 _correspondingStaticParameters = parameters; |
| 460 } | 451 } |
| 461 | 452 |
| 462 @override | 453 @override |
| 463 Token get endToken => rightParenthesis; | 454 Token get endToken => rightParenthesis; |
| 464 | 455 |
| 465 @override | 456 @override |
| 466 accept(AstVisitor visitor) => visitor.visitArgumentList(this); | 457 accept(AstVisitor visitor) => visitor.visitArgumentList(this); |
| 467 | 458 |
| 468 /** | |
| 469 * If | |
| 470 * * the given [expression] is a child of this list, | |
| 471 * * the AST structure has been resolved, | |
| 472 * * the function being invoked is known based on propagated type information, | |
| 473 * and | |
| 474 * * the expression corresponds to one of the parameters of the function being | |
| 475 * invoked, | |
| 476 * then return the parameter element representing the parameter to which the | |
| 477 * value of the given expression will be bound. Otherwise, return `null`. | |
| 478 */ | |
| 479 @deprecated // Use "expression.propagatedParameterElement" | |
| 480 ParameterElement getPropagatedParameterElementFor(Expression expression) { | |
| 481 return _getPropagatedParameterElementFor(expression); | |
| 482 } | |
| 483 | |
| 484 /** | |
| 485 * If | |
| 486 * * the given [expression] is a child of this list, | |
| 487 * * the AST structure has been resolved, | |
| 488 * * the function being invoked is known based on static type information, and | |
| 489 * * the expression corresponds to one of the parameters of the function being | |
| 490 * invoked, | |
| 491 * then return the parameter element representing the parameter to which the | |
| 492 * value of the given expression will be bound. Otherwise, return `null`. | |
| 493 */ | |
| 494 @deprecated // Use "expression.staticParameterElement" | |
| 495 ParameterElement getStaticParameterElementFor(Expression expression) { | |
| 496 return _getStaticParameterElementFor(expression); | |
| 497 } | |
| 498 | |
| 499 @override | 459 @override |
| 500 void visitChildren(AstVisitor visitor) { | 460 void visitChildren(AstVisitor visitor) { |
| 501 _arguments.accept(visitor); | 461 _arguments.accept(visitor); |
| 502 } | 462 } |
| 503 | 463 |
| 504 /** | 464 /** |
| 505 * If | 465 * If |
| 506 * * the given [expression] is a child of this list, | 466 * * the given [expression] is a child of this list, |
| 507 * * the AST structure has been resolved, | 467 * * the AST structure has been resolved, |
| 508 * * the function being invoked is known based on propagated type information, | 468 * * the function being invoked is known based on propagated type information, |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 * [expression]. | 674 * [expression]. |
| 715 */ | 675 */ |
| 716 void set condition(Expression condition) { | 676 void set condition(Expression condition) { |
| 717 _condition = _becomeParentOf(condition); | 677 _condition = _becomeParentOf(condition); |
| 718 } | 678 } |
| 719 | 679 |
| 720 @override | 680 @override |
| 721 Token get endToken => semicolon; | 681 Token get endToken => semicolon; |
| 722 | 682 |
| 723 /** | 683 /** |
| 724 * Return the token representing the 'assert' keyword. | |
| 725 */ | |
| 726 @deprecated // Use "this.assertKeyword" | |
| 727 Token get keyword => assertKeyword; | |
| 728 | |
| 729 /** | |
| 730 * Set the token representing the 'assert' keyword to the given [token]. | |
| 731 */ | |
| 732 @deprecated // Use "this.assertKeyword" | |
| 733 set keyword(Token token) { | |
| 734 assertKeyword = token; | |
| 735 } | |
| 736 | |
| 737 /** | |
| 738 * Return the message to report if the assertion fails. | 684 * Return the message to report if the assertion fails. |
| 739 */ | 685 */ |
| 740 Expression get message => _message; | 686 Expression get message => _message; |
| 741 | 687 |
| 742 /** | 688 /** |
| 743 * Set the message to report if the assertion fails to the given | 689 * Set the message to report if the assertion fails to the given |
| 744 * [expression]. | 690 * [expression]. |
| 745 */ | 691 */ |
| 746 void set message(Expression expression) { | 692 void set message(Expression expression) { |
| 747 _message = _becomeParentOf(expression); | 693 _message = _becomeParentOf(expression); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 * Return the expression used to compute the left hand side. | 801 * Return the expression used to compute the left hand side. |
| 856 */ | 802 */ |
| 857 void set leftHandSide(Expression expression) { | 803 void set leftHandSide(Expression expression) { |
| 858 _leftHandSide = _becomeParentOf(expression); | 804 _leftHandSide = _becomeParentOf(expression); |
| 859 } | 805 } |
| 860 | 806 |
| 861 @override | 807 @override |
| 862 int get precedence => 1; | 808 int get precedence => 1; |
| 863 | 809 |
| 864 /** | 810 /** |
| 865 * If the AST structure has been resolved, and the function being invoked is | |
| 866 * known based on propagated type information, then return the parameter | |
| 867 * element representing the parameter to which the value of the right operand | |
| 868 * will be bound. Otherwise, return `null`. | |
| 869 */ | |
| 870 @deprecated // Use "expression.propagatedParameterElement" | |
| 871 ParameterElement get propagatedParameterElementForRightHandSide { | |
| 872 return _propagatedParameterElementForRightHandSide; | |
| 873 } | |
| 874 | |
| 875 /** | |
| 876 * Return the expression used to compute the right hand side. | 811 * Return the expression used to compute the right hand side. |
| 877 */ | 812 */ |
| 878 Expression get rightHandSide => _rightHandSide; | 813 Expression get rightHandSide => _rightHandSide; |
| 879 | 814 |
| 880 /** | 815 /** |
| 881 * Set the expression used to compute the left hand side to the given | 816 * Set the expression used to compute the left hand side to the given |
| 882 * [expression]. | 817 * [expression]. |
| 883 */ | 818 */ |
| 884 void set rightHandSide(Expression expression) { | 819 void set rightHandSide(Expression expression) { |
| 885 _rightHandSide = _becomeParentOf(expression); | 820 _rightHandSide = _becomeParentOf(expression); |
| 886 } | 821 } |
| 887 | 822 |
| 888 /** | 823 /** |
| 889 * If the AST structure has been resolved, and the function being invoked is | 824 * If the AST structure has been resolved, and the function being invoked is |
| 890 * known based on static type information, then return the parameter element | |
| 891 * representing the parameter to which the value of the right operand will be | |
| 892 * bound. Otherwise, return `null`. | |
| 893 */ | |
| 894 @deprecated // Use "expression.staticParameterElement" | |
| 895 ParameterElement get staticParameterElementForRightHandSide { | |
| 896 return _staticParameterElementForRightHandSide; | |
| 897 } | |
| 898 | |
| 899 /** | |
| 900 * If the AST structure has been resolved, and the function being invoked is | |
| 901 * known based on propagated type information, then return the parameter | 825 * known based on propagated type information, then return the parameter |
| 902 * element representing the parameter to which the value of the right operand | 826 * element representing the parameter to which the value of the right operand |
| 903 * will be bound. Otherwise, return `null`. | 827 * will be bound. Otherwise, return `null`. |
| 904 */ | 828 */ |
| 905 ParameterElement get _propagatedParameterElementForRightHandSide { | 829 ParameterElement get _propagatedParameterElementForRightHandSide { |
| 906 ExecutableElement executableElement = null; | 830 ExecutableElement executableElement = null; |
| 907 if (propagatedElement != null) { | 831 if (propagatedElement != null) { |
| 908 executableElement = propagatedElement; | 832 executableElement = propagatedElement; |
| 909 } else { | 833 } else { |
| 910 if (_leftHandSide is Identifier) { | 834 if (_leftHandSide is Identifier) { |
| (...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2933 } | 2857 } |
| 2934 } | 2858 } |
| 2935 | 2859 |
| 2936 /** | 2860 /** |
| 2937 * A node in the AST structure for a Dart program. | 2861 * A node in the AST structure for a Dart program. |
| 2938 */ | 2862 */ |
| 2939 abstract class AstNode { | 2863 abstract class AstNode { |
| 2940 /** | 2864 /** |
| 2941 * An empty list of AST nodes. | 2865 * An empty list of AST nodes. |
| 2942 */ | 2866 */ |
| 2943 @deprecated // Use "AstNode.EMPTY_LIST" | |
| 2944 static const List<AstNode> EMPTY_ARRAY = EMPTY_LIST; | |
| 2945 | |
| 2946 /** | |
| 2947 * An empty list of AST nodes. | |
| 2948 */ | |
| 2949 static const List<AstNode> EMPTY_LIST = const <AstNode>[]; | 2867 static const List<AstNode> EMPTY_LIST = const <AstNode>[]; |
| 2950 | 2868 |
| 2951 /** | 2869 /** |
| 2952 * A comparator that can be used to sort AST nodes in lexical order. In other | 2870 * A comparator that can be used to sort AST nodes in lexical order. In other |
| 2953 * words, `compare` will return a negative value if the offset of the first | 2871 * words, `compare` will return a negative value if the offset of the first |
| 2954 * node is less than the offset of the second node, zero (0) if the nodes have | 2872 * node is less than the offset of the second node, zero (0) if the nodes have |
| 2955 * the same offset, and a positive value if the offset of the first node is | 2873 * the same offset, and a positive value if the offset of the first node is |
| 2956 * greater than the offset of the second node. | 2874 * greater than the offset of the second node. |
| 2957 */ | 2875 */ |
| 2958 static Comparator<AstNode> LEXICAL_ORDER = (AstNode first, AstNode second) => | 2876 static Comparator<AstNode> LEXICAL_ORDER = (AstNode first, AstNode second) => |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3031 /** | 2949 /** |
| 3032 * Return this node's parent node, or `null` if this node is the root of an | 2950 * Return this node's parent node, or `null` if this node is the root of an |
| 3033 * AST structure. | 2951 * AST structure. |
| 3034 * | 2952 * |
| 3035 * Note that the relationship between an AST node and its parent node may | 2953 * Note that the relationship between an AST node and its parent node may |
| 3036 * change over the lifetime of a node. | 2954 * change over the lifetime of a node. |
| 3037 */ | 2955 */ |
| 3038 AstNode get parent => _parent; | 2956 AstNode get parent => _parent; |
| 3039 | 2957 |
| 3040 /** | 2958 /** |
| 3041 * Set the parent of this node to the [newParent]. | |
| 3042 */ | |
| 3043 @deprecated // Never intended for public use. | |
| 3044 void set parent(AstNode newParent) { | |
| 3045 _parent = newParent; | |
| 3046 } | |
| 3047 | |
| 3048 /** | |
| 3049 * Return the node at the root of this node's AST structure. Note that this | 2959 * Return the node at the root of this node's AST structure. Note that this |
| 3050 * method's performance is linear with respect to the depth of the node in the | 2960 * method's performance is linear with respect to the depth of the node in the |
| 3051 * AST structure (O(depth)). | 2961 * AST structure (O(depth)). |
| 3052 */ | 2962 */ |
| 3053 AstNode get root { | 2963 AstNode get root { |
| 3054 AstNode root = this; | 2964 AstNode root = this; |
| 3055 AstNode parent = this.parent; | 2965 AstNode parent = this.parent; |
| 3056 while (parent != null) { | 2966 while (parent != null) { |
| 3057 root = parent; | 2967 root = parent; |
| 3058 parent = root.parent; | 2968 parent = root.parent; |
| 3059 } | 2969 } |
| 3060 return root; | 2970 return root; |
| 3061 } | 2971 } |
| 3062 | 2972 |
| 3063 /** | 2973 /** |
| 3064 * Use the given [visitor] to visit this node. Return the value returned by | 2974 * Use the given [visitor] to visit this node. Return the value returned by |
| 3065 * the visitor as a result of visiting this node. | 2975 * the visitor as a result of visiting this node. |
| 3066 */ | 2976 */ |
| 3067 /* <E> E */ accept(AstVisitor /*<E>*/ visitor); | 2977 /* <E> E */ accept(AstVisitor /*<E>*/ visitor); |
| 3068 | 2978 |
| 3069 /** | 2979 /** |
| 3070 * Make this node the parent of the given [child] node. Return the child node. | |
| 3071 */ | |
| 3072 @deprecated // Never intended for public use. | |
| 3073 AstNode becomeParentOf(AstNode child) { | |
| 3074 return _becomeParentOf(child); | |
| 3075 } | |
| 3076 | |
| 3077 /** | |
| 3078 * Return the most immediate ancestor of this node for which the [predicate] | 2980 * Return the most immediate ancestor of this node for which the [predicate] |
| 3079 * returns `true`, or `null` if there is no such ancestor. Note that this node | 2981 * returns `true`, or `null` if there is no such ancestor. Note that this node |
| 3080 * will never be returned. | 2982 * will never be returned. |
| 3081 */ | 2983 */ |
| 3082 AstNode getAncestor(Predicate<AstNode> predicate) { | 2984 AstNode getAncestor(Predicate<AstNode> predicate) { |
| 3083 // TODO(brianwilkerson) It is a bug that this method can return `this`. | 2985 // TODO(brianwilkerson) It is a bug that this method can return `this`. |
| 3084 AstNode node = this; | 2986 AstNode node = this; |
| 3085 while (node != null && !predicate(node)) { | 2987 while (node != null && !predicate(node)) { |
| 3086 node = node.parent; | 2988 node = node.parent; |
| 3087 } | 2989 } |
| 3088 return node; | 2990 return node; |
| 3089 } | 2991 } |
| 3090 | 2992 |
| 3091 /** | 2993 /** |
| 3092 * Return the value of the property with the given [name], or `null` if this | 2994 * Return the value of the property with the given [name], or `null` if this |
| 3093 * node does not have a property with the given name. | 2995 * node does not have a property with the given name. |
| 3094 */ | 2996 */ |
| 3095 Object getProperty(String name) { | 2997 Object getProperty(String name) { |
| 3096 if (_propertyMap == null) { | 2998 if (_propertyMap == null) { |
| 3097 return null; | 2999 return null; |
| 3098 } | 3000 } |
| 3099 return _propertyMap[name]; | 3001 return _propertyMap[name]; |
| 3100 } | 3002 } |
| 3101 | 3003 |
| 3102 /** | 3004 /** |
| 3103 * If the given [child] is not `null`, use the given [visitor] to visit it. | |
| 3104 */ | |
| 3105 @deprecated // Never intended for public use. | |
| 3106 void safelyVisitChild(AstNode child, AstVisitor visitor) { | |
| 3107 if (child != null) { | |
| 3108 child.accept(visitor); | |
| 3109 } | |
| 3110 } | |
| 3111 | |
| 3112 /** | |
| 3113 * Set the value of the property with the given [name] to the given [value]. | 3005 * Set the value of the property with the given [name] to the given [value]. |
| 3114 * If the value is `null`, the property will effectively be removed. | 3006 * If the value is `null`, the property will effectively be removed. |
| 3115 */ | 3007 */ |
| 3116 void setProperty(String name, Object value) { | 3008 void setProperty(String name, Object value) { |
| 3117 if (value == null) { | 3009 if (value == null) { |
| 3118 if (_propertyMap != null) { | 3010 if (_propertyMap != null) { |
| 3119 _propertyMap.remove(name); | 3011 _propertyMap.remove(name); |
| 3120 if (_propertyMap.isEmpty) { | 3012 if (_propertyMap.isEmpty) { |
| 3121 _propertyMap = null; | 3013 _propertyMap = null; |
| 3122 } | 3014 } |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3535 * [expression]. | 3427 * [expression]. |
| 3536 */ | 3428 */ |
| 3537 void set leftOperand(Expression expression) { | 3429 void set leftOperand(Expression expression) { |
| 3538 _leftOperand = _becomeParentOf(expression); | 3430 _leftOperand = _becomeParentOf(expression); |
| 3539 } | 3431 } |
| 3540 | 3432 |
| 3541 @override | 3433 @override |
| 3542 int get precedence => operator.type.precedence; | 3434 int get precedence => operator.type.precedence; |
| 3543 | 3435 |
| 3544 /** | 3436 /** |
| 3545 * If the AST structure has been resolved, and the function being invoked is | |
| 3546 * known based on propagated type information, then return the parameter | |
| 3547 * element representing the parameter to which the value of the right operand | |
| 3548 * will be bound. Otherwise, return `null`. | |
| 3549 */ | |
| 3550 @deprecated // Use "expression.propagatedParameterElement" | |
| 3551 ParameterElement get propagatedParameterElementForRightOperand { | |
| 3552 return _propagatedParameterElementForRightOperand; | |
| 3553 } | |
| 3554 | |
| 3555 /** | |
| 3556 * Return the expression used to compute the right operand. | 3437 * Return the expression used to compute the right operand. |
| 3557 */ | 3438 */ |
| 3558 Expression get rightOperand => _rightOperand; | 3439 Expression get rightOperand => _rightOperand; |
| 3559 | 3440 |
| 3560 /** | 3441 /** |
| 3561 * Set the expression used to compute the right operand to the given | 3442 * Set the expression used to compute the right operand to the given |
| 3562 * [expression]. | 3443 * [expression]. |
| 3563 */ | 3444 */ |
| 3564 void set rightOperand(Expression expression) { | 3445 void set rightOperand(Expression expression) { |
| 3565 _rightOperand = _becomeParentOf(expression); | 3446 _rightOperand = _becomeParentOf(expression); |
| 3566 } | 3447 } |
| 3567 | 3448 |
| 3568 /** | 3449 /** |
| 3569 * If the AST structure has been resolved, and the function being invoked is | 3450 * If the AST structure has been resolved, and the function being invoked is |
| 3570 * known based on static type information, then return the parameter element | |
| 3571 * representing the parameter to which the value of the right operand will be | |
| 3572 * bound. Otherwise, return `null`. | |
| 3573 */ | |
| 3574 @deprecated // Use "expression.staticParameterElement" | |
| 3575 ParameterElement get staticParameterElementForRightOperand { | |
| 3576 return _staticParameterElementForRightOperand; | |
| 3577 } | |
| 3578 | |
| 3579 /** | |
| 3580 * If the AST structure has been resolved, and the function being invoked is | |
| 3581 * known based on propagated type information, then return the parameter | 3451 * known based on propagated type information, then return the parameter |
| 3582 * element representing the parameter to which the value of the right operand | 3452 * element representing the parameter to which the value of the right operand |
| 3583 * will be bound. Otherwise, return `null`. | 3453 * will be bound. Otherwise, return `null`. |
| 3584 */ | 3454 */ |
| 3585 ParameterElement get _propagatedParameterElementForRightOperand { | 3455 ParameterElement get _propagatedParameterElementForRightOperand { |
| 3586 if (propagatedElement == null) { | 3456 if (propagatedElement == null) { |
| 3587 return null; | 3457 return null; |
| 3588 } | 3458 } |
| 3589 List<ParameterElement> parameters = propagatedElement.parameters; | 3459 List<ParameterElement> parameters = propagatedElement.parameters; |
| 3590 if (parameters.length < 1) { | 3460 if (parameters.length < 1) { |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3897 Token get beginToken => breakKeyword; | 3767 Token get beginToken => breakKeyword; |
| 3898 | 3768 |
| 3899 @override | 3769 @override |
| 3900 Iterable get childEntities => | 3770 Iterable get childEntities => |
| 3901 new ChildEntities()..add(breakKeyword)..add(_label)..add(semicolon); | 3771 new ChildEntities()..add(breakKeyword)..add(_label)..add(semicolon); |
| 3902 | 3772 |
| 3903 @override | 3773 @override |
| 3904 Token get endToken => semicolon; | 3774 Token get endToken => semicolon; |
| 3905 | 3775 |
| 3906 /** | 3776 /** |
| 3907 * Return the token representing the 'break' keyword. | |
| 3908 */ | |
| 3909 @deprecated // Use "this.breakKeyword" | |
| 3910 Token get keyword => breakKeyword; | |
| 3911 | |
| 3912 /** | |
| 3913 * Set the token representing the 'break' keyword to the given [token]. | |
| 3914 */ | |
| 3915 @deprecated // Use "this.breakKeyword" | |
| 3916 void set keyword(Token token) { | |
| 3917 breakKeyword = token; | |
| 3918 } | |
| 3919 | |
| 3920 /** | |
| 3921 * Return the label associated with the statement, or `null` if there is no | 3777 * Return the label associated with the statement, or `null` if there is no |
| 3922 * label. | 3778 * label. |
| 3923 */ | 3779 */ |
| 3924 SimpleIdentifier get label => _label; | 3780 SimpleIdentifier get label => _label; |
| 3925 | 3781 |
| 3926 /** | 3782 /** |
| 3927 * Set the label associated with the statement to the given [identifier]. | 3783 * Set the label associated with the statement to the given [identifier]. |
| 3928 */ | 3784 */ |
| 3929 void set label(SimpleIdentifier identifier) { | 3785 void set label(SimpleIdentifier identifier) { |
| 3930 _label = _becomeParentOf(identifier); | 3786 _label = _becomeParentOf(identifier); |
| (...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5972 */ | 5828 */ |
| 5973 SimpleIdentifier get fieldName => _fieldName; | 5829 SimpleIdentifier get fieldName => _fieldName; |
| 5974 | 5830 |
| 5975 /** | 5831 /** |
| 5976 * Set the name of the field being initialized to the given [identifier]. | 5832 * Set the name of the field being initialized to the given [identifier]. |
| 5977 */ | 5833 */ |
| 5978 void set fieldName(SimpleIdentifier identifier) { | 5834 void set fieldName(SimpleIdentifier identifier) { |
| 5979 _fieldName = _becomeParentOf(identifier); | 5835 _fieldName = _becomeParentOf(identifier); |
| 5980 } | 5836 } |
| 5981 | 5837 |
| 5982 /** | |
| 5983 * Return the token for the 'this' keyword, or `null` if there is no 'this' | |
| 5984 * keyword. | |
| 5985 */ | |
| 5986 @deprecated // Use "this.thisKeyword" | |
| 5987 Token get keyword => thisKeyword; | |
| 5988 | |
| 5989 /** | |
| 5990 * Set the token for the 'this' keyword to the given [token]. | |
| 5991 */ | |
| 5992 @deprecated // Use "this.thisKeyword" | |
| 5993 set keyword(Token token) { | |
| 5994 thisKeyword = token; | |
| 5995 } | |
| 5996 | |
| 5997 @override | 5838 @override |
| 5998 accept(AstVisitor visitor) => visitor.visitConstructorFieldInitializer(this); | 5839 accept(AstVisitor visitor) => visitor.visitConstructorFieldInitializer(this); |
| 5999 | 5840 |
| 6000 @override | 5841 @override |
| 6001 void visitChildren(AstVisitor visitor) { | 5842 void visitChildren(AstVisitor visitor) { |
| 6002 _safelyVisitChild(_fieldName, visitor); | 5843 _safelyVisitChild(_fieldName, visitor); |
| 6003 _safelyVisitChild(_expression, visitor); | 5844 _safelyVisitChild(_expression, visitor); |
| 6004 } | 5845 } |
| 6005 } | 5846 } |
| 6006 | 5847 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6149 Token get beginToken => continueKeyword; | 5990 Token get beginToken => continueKeyword; |
| 6150 | 5991 |
| 6151 @override | 5992 @override |
| 6152 Iterable get childEntities => | 5993 Iterable get childEntities => |
| 6153 new ChildEntities()..add(continueKeyword)..add(_label)..add(semicolon); | 5994 new ChildEntities()..add(continueKeyword)..add(_label)..add(semicolon); |
| 6154 | 5995 |
| 6155 @override | 5996 @override |
| 6156 Token get endToken => semicolon; | 5997 Token get endToken => semicolon; |
| 6157 | 5998 |
| 6158 /** | 5999 /** |
| 6159 * Return the token for the 'continue' keyword, or `null` if there is no | |
| 6160 * 'continue' keyword. | |
| 6161 */ | |
| 6162 @deprecated // Use "this.continueKeyword" | |
| 6163 Token get keyword => continueKeyword; | |
| 6164 | |
| 6165 /** | |
| 6166 * Set the token for the 'continue' keyword to the given [token]. | |
| 6167 */ | |
| 6168 @deprecated // Use "this.continueKeyword" | |
| 6169 set keyword(Token token) { | |
| 6170 continueKeyword = token; | |
| 6171 } | |
| 6172 | |
| 6173 /** | |
| 6174 * Return the label associated with the statement, or `null` if there is no | 6000 * Return the label associated with the statement, or `null` if there is no |
| 6175 * label. | 6001 * label. |
| 6176 */ | 6002 */ |
| 6177 SimpleIdentifier get label => _label; | 6003 SimpleIdentifier get label => _label; |
| 6178 | 6004 |
| 6179 /** | 6005 /** |
| 6180 * Set the label associated with the statement to the given [identifier]. | 6006 * Set the label associated with the statement to the given [identifier]. |
| 6181 */ | 6007 */ |
| 6182 void set label(SimpleIdentifier identifier) { | 6008 void set label(SimpleIdentifier identifier) { |
| 6183 _label = _becomeParentOf(identifier); | 6009 _label = _becomeParentOf(identifier); |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7009 @override | 6835 @override |
| 7010 ClassElement get element => | 6836 ClassElement get element => |
| 7011 _name != null ? (_name.staticElement as ClassElement) : null; | 6837 _name != null ? (_name.staticElement as ClassElement) : null; |
| 7012 | 6838 |
| 7013 @override | 6839 @override |
| 7014 Token get endToken => rightBracket; | 6840 Token get endToken => rightBracket; |
| 7015 | 6841 |
| 7016 @override | 6842 @override |
| 7017 Token get firstTokenAfterCommentAndMetadata => enumKeyword; | 6843 Token get firstTokenAfterCommentAndMetadata => enumKeyword; |
| 7018 | 6844 |
| 7019 /** | |
| 7020 * Return the token for the 'enum' keyword, or `null` if there is no | |
| 7021 * 'enum' keyword. | |
| 7022 */ | |
| 7023 @deprecated // Use "this.enumKeyword" | |
| 7024 Token get keyword => enumKeyword; | |
| 7025 | |
| 7026 /** | |
| 7027 * Set the token for the 'enum' keyword to the given [token]. | |
| 7028 */ | |
| 7029 @deprecated // Use "this.enumKeyword" | |
| 7030 set keyword(Token token) { | |
| 7031 enumKeyword = token; | |
| 7032 } | |
| 7033 | |
| 7034 @override | 6845 @override |
| 7035 accept(AstVisitor visitor) => visitor.visitEnumDeclaration(this); | 6846 accept(AstVisitor visitor) => visitor.visitEnumDeclaration(this); |
| 7036 | 6847 |
| 7037 @override | 6848 @override |
| 7038 void visitChildren(AstVisitor visitor) { | 6849 void visitChildren(AstVisitor visitor) { |
| 7039 super.visitChildren(visitor); | 6850 super.visitChildren(visitor); |
| 7040 _safelyVisitChild(_name, visitor); | 6851 _safelyVisitChild(_name, visitor); |
| 7041 _constants.accept(visitor); | 6852 _constants.accept(visitor); |
| 7042 } | 6853 } |
| 7043 } | 6854 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7109 * | 6920 * |
| 7110 * > expression ::= | 6921 * > expression ::= |
| 7111 * > [AssignmentExpression] | 6922 * > [AssignmentExpression] |
| 7112 * > | [ConditionalExpression] cascadeSection* | 6923 * > | [ConditionalExpression] cascadeSection* |
| 7113 * > | [ThrowExpression] | 6924 * > | [ThrowExpression] |
| 7114 */ | 6925 */ |
| 7115 abstract class Expression extends AstNode { | 6926 abstract class Expression extends AstNode { |
| 7116 /** | 6927 /** |
| 7117 * An empty list of expressions. | 6928 * An empty list of expressions. |
| 7118 */ | 6929 */ |
| 7119 @deprecated // Use "Expression.EMPTY_LIST" | |
| 7120 static const List<Expression> EMPTY_ARRAY = EMPTY_LIST; | |
| 7121 | |
| 7122 /** | |
| 7123 * An empty list of expressions. | |
| 7124 */ | |
| 7125 static const List<Expression> EMPTY_LIST = const <Expression>[]; | 6930 static const List<Expression> EMPTY_LIST = const <Expression>[]; |
| 7126 | 6931 |
| 7127 /** | 6932 /** |
| 7128 * The static type of this expression, or `null` if the AST structure has not | 6933 * The static type of this expression, or `null` if the AST structure has not |
| 7129 * been resolved. | 6934 * been resolved. |
| 7130 */ | 6935 */ |
| 7131 DartType staticType; | 6936 DartType staticType; |
| 7132 | 6937 |
| 7133 /** | 6938 /** |
| 7134 * The propagated type of this expression, or `null` if type propagation has | 6939 * The propagated type of this expression, or `null` if type propagation has |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7437 Token get beginToken => extendsKeyword; | 7242 Token get beginToken => extendsKeyword; |
| 7438 | 7243 |
| 7439 @override | 7244 @override |
| 7440 Iterable get childEntities => | 7245 Iterable get childEntities => |
| 7441 new ChildEntities()..add(extendsKeyword)..add(_superclass); | 7246 new ChildEntities()..add(extendsKeyword)..add(_superclass); |
| 7442 | 7247 |
| 7443 @override | 7248 @override |
| 7444 Token get endToken => _superclass.endToken; | 7249 Token get endToken => _superclass.endToken; |
| 7445 | 7250 |
| 7446 /** | 7251 /** |
| 7447 * Return the token for the 'extends' keyword. | |
| 7448 */ | |
| 7449 @deprecated // Use "this.extendsKeyword" | |
| 7450 Token get keyword => extendsKeyword; | |
| 7451 | |
| 7452 /** | |
| 7453 * Set the token for the 'extends' keyword to the given [token]. | |
| 7454 */ | |
| 7455 @deprecated // Use "this.extendsKeyword" | |
| 7456 set keyword(Token token) { | |
| 7457 extendsKeyword = token; | |
| 7458 } | |
| 7459 | |
| 7460 /** | |
| 7461 * Return the name of the class that is being extended. | 7252 * Return the name of the class that is being extended. |
| 7462 */ | 7253 */ |
| 7463 TypeName get superclass => _superclass; | 7254 TypeName get superclass => _superclass; |
| 7464 | 7255 |
| 7465 /** | 7256 /** |
| 7466 * Set the name of the class that is being extended to the given [name]. | 7257 * Set the name of the class that is being extended to the given [name]. |
| 7467 */ | 7258 */ |
| 7468 void set superclass(TypeName name) { | 7259 void set superclass(TypeName name) { |
| 7469 _superclass = _becomeParentOf(name); | 7260 _superclass = _becomeParentOf(name); |
| 7470 } | 7261 } |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7668 | 7459 |
| 7669 /** | 7460 /** |
| 7670 * Set the parameters of the function-typed parameter to the given | 7461 * Set the parameters of the function-typed parameter to the given |
| 7671 * [parameters]. | 7462 * [parameters]. |
| 7672 */ | 7463 */ |
| 7673 void set parameters(FormalParameterList parameters) { | 7464 void set parameters(FormalParameterList parameters) { |
| 7674 _parameters = _becomeParentOf(parameters); | 7465 _parameters = _becomeParentOf(parameters); |
| 7675 } | 7466 } |
| 7676 | 7467 |
| 7677 /** | 7468 /** |
| 7678 * Return the token representing the 'this' keyword. | |
| 7679 */ | |
| 7680 @deprecated // Use "this.thisKeyword" | |
| 7681 Token get thisToken => thisKeyword; | |
| 7682 | |
| 7683 /** | |
| 7684 * Set the token representing the 'this' keyword to the given [token]. | |
| 7685 */ | |
| 7686 @deprecated // Use "this.thisKeyword" | |
| 7687 set thisToken(Token token) { | |
| 7688 thisKeyword = token; | |
| 7689 } | |
| 7690 | |
| 7691 /** | |
| 7692 * Return the name of the declared type of the parameter, or `null` if the | 7469 * Return the name of the declared type of the parameter, or `null` if the |
| 7693 * parameter does not have a declared type. Note that if this is a | 7470 * parameter does not have a declared type. Note that if this is a |
| 7694 * function-typed field formal parameter this is the return type of the | 7471 * function-typed field formal parameter this is the return type of the |
| 7695 * function. | 7472 * function. |
| 7696 */ | 7473 */ |
| 7697 TypeName get type => _type; | 7474 TypeName get type => _type; |
| 7698 | 7475 |
| 7699 /** | 7476 /** |
| 7700 * Set the name of the declared type of the parameter to the given [typeName]. | 7477 * Set the name of the declared type of the parameter to the given [typeName]. |
| 7701 */ | 7478 */ |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7779 * The right parenthesis. | 7556 * The right parenthesis. |
| 7780 */ | 7557 */ |
| 7781 Token rightParenthesis; | 7558 Token rightParenthesis; |
| 7782 | 7559 |
| 7783 /** | 7560 /** |
| 7784 * The body of the loop. | 7561 * The body of the loop. |
| 7785 */ | 7562 */ |
| 7786 Statement _body; | 7563 Statement _body; |
| 7787 | 7564 |
| 7788 /** | 7565 /** |
| 7789 * Initialize a newly created for-each statement. The [awaitKeyword] can be | |
| 7790 * `null` if this is not an asynchronous for loop. | |
| 7791 */ | |
| 7792 @deprecated // Use new ForEachStatement.withDeclaration(...) | |
| 7793 ForEachStatement.con1( | |
| 7794 this.awaitKeyword, | |
| 7795 this.forKeyword, | |
| 7796 this.leftParenthesis, | |
| 7797 DeclaredIdentifier loopVariable, | |
| 7798 this.inKeyword, | |
| 7799 Expression iterator, | |
| 7800 this.rightParenthesis, | |
| 7801 Statement body) { | |
| 7802 _loopVariable = _becomeParentOf(loopVariable); | |
| 7803 _iterable = _becomeParentOf(iterator); | |
| 7804 _body = _becomeParentOf(body); | |
| 7805 } | |
| 7806 | |
| 7807 /** | |
| 7808 * Initialize a newly created for-each statement. The [awaitKeyword] can be | |
| 7809 * `null` if this is not an asynchronous for loop. | |
| 7810 */ | |
| 7811 @deprecated // Use new ForEachStatement.withReference(...) | |
| 7812 ForEachStatement.con2( | |
| 7813 this.awaitKeyword, | |
| 7814 this.forKeyword, | |
| 7815 this.leftParenthesis, | |
| 7816 SimpleIdentifier identifier, | |
| 7817 this.inKeyword, | |
| 7818 Expression iterator, | |
| 7819 this.rightParenthesis, | |
| 7820 Statement body) { | |
| 7821 _identifier = _becomeParentOf(identifier); | |
| 7822 _iterable = _becomeParentOf(iterator); | |
| 7823 _body = _becomeParentOf(body); | |
| 7824 } | |
| 7825 | |
| 7826 /** | |
| 7827 * Initialize a newly created for-each statement whose loop control variable | 7566 * Initialize a newly created for-each statement whose loop control variable |
| 7828 * is declared internally (in the for-loop part). The [awaitKeyword] can be | 7567 * is declared internally (in the for-loop part). The [awaitKeyword] can be |
| 7829 * `null` if this is not an asynchronous for loop. | 7568 * `null` if this is not an asynchronous for loop. |
| 7830 */ | 7569 */ |
| 7831 ForEachStatement.withDeclaration( | 7570 ForEachStatement.withDeclaration( |
| 7832 this.awaitKeyword, | 7571 this.awaitKeyword, |
| 7833 this.forKeyword, | 7572 this.forKeyword, |
| 7834 this.leftParenthesis, | 7573 this.leftParenthesis, |
| 7835 DeclaredIdentifier loopVariable, | 7574 DeclaredIdentifier loopVariable, |
| 7836 this.inKeyword, | 7575 this.inKeyword, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7911 | 7650 |
| 7912 /** | 7651 /** |
| 7913 * Set the expression evaluated to produce the iterator to the given | 7652 * Set the expression evaluated to produce the iterator to the given |
| 7914 * [expression]. | 7653 * [expression]. |
| 7915 */ | 7654 */ |
| 7916 void set iterable(Expression expression) { | 7655 void set iterable(Expression expression) { |
| 7917 _iterable = _becomeParentOf(expression); | 7656 _iterable = _becomeParentOf(expression); |
| 7918 } | 7657 } |
| 7919 | 7658 |
| 7920 /** | 7659 /** |
| 7921 * Return the expression evaluated to produce the iterator. | |
| 7922 */ | |
| 7923 @deprecated // Use "this.iterable" | |
| 7924 Expression get iterator => iterable; | |
| 7925 | |
| 7926 /** | |
| 7927 * Return the declaration of the loop variable, or `null` if the loop variable | 7660 * Return the declaration of the loop variable, or `null` if the loop variable |
| 7928 * is a simple identifier. | 7661 * is a simple identifier. |
| 7929 */ | 7662 */ |
| 7930 DeclaredIdentifier get loopVariable => _loopVariable; | 7663 DeclaredIdentifier get loopVariable => _loopVariable; |
| 7931 | 7664 |
| 7932 /** | 7665 /** |
| 7933 * Set the declaration of the loop variable to the given [variable]. | 7666 * Set the declaration of the loop variable to the given [variable]. |
| 7934 */ | 7667 */ |
| 7935 void set loopVariable(DeclaredIdentifier variable) { | 7668 void set loopVariable(DeclaredIdentifier variable) { |
| 7936 _loopVariable = _becomeParentOf(variable); | 7669 _loopVariable = _becomeParentOf(variable); |
| (...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9695 ..addAll(interfaces); | 9428 ..addAll(interfaces); |
| 9696 | 9429 |
| 9697 @override | 9430 @override |
| 9698 Token get endToken => _interfaces.endToken; | 9431 Token get endToken => _interfaces.endToken; |
| 9699 | 9432 |
| 9700 /** | 9433 /** |
| 9701 * Return the list of the interfaces that are being implemented. | 9434 * Return the list of the interfaces that are being implemented. |
| 9702 */ | 9435 */ |
| 9703 NodeList<TypeName> get interfaces => _interfaces; | 9436 NodeList<TypeName> get interfaces => _interfaces; |
| 9704 | 9437 |
| 9705 /** | |
| 9706 * Return the token representing the 'implements' keyword. | |
| 9707 */ | |
| 9708 @deprecated // Use "this.implementsKeyword" | |
| 9709 Token get keyword => implementsKeyword; | |
| 9710 | |
| 9711 /** | |
| 9712 * Set the token representing the 'implements' keyword to the given [token]. | |
| 9713 */ | |
| 9714 @deprecated // Use "this.implementsKeyword" | |
| 9715 set keyword(Token token) { | |
| 9716 implementsKeyword = token; | |
| 9717 } | |
| 9718 | |
| 9719 @override | 9438 @override |
| 9720 accept(AstVisitor visitor) => visitor.visitImplementsClause(this); | 9439 accept(AstVisitor visitor) => visitor.visitImplementsClause(this); |
| 9721 | 9440 |
| 9722 @override | 9441 @override |
| 9723 void visitChildren(AstVisitor visitor) { | 9442 void visitChildren(AstVisitor visitor) { |
| 9724 _interfaces.accept(visitor); | 9443 _interfaces.accept(visitor); |
| 9725 } | 9444 } |
| 9726 } | 9445 } |
| 9727 | 9446 |
| 9728 /** | 9447 /** |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9862 this.deferredKeyword, | 9581 this.deferredKeyword, |
| 9863 this.asKeyword, | 9582 this.asKeyword, |
| 9864 SimpleIdentifier prefix, | 9583 SimpleIdentifier prefix, |
| 9865 List<Combinator> combinators, | 9584 List<Combinator> combinators, |
| 9866 Token semicolon) | 9585 Token semicolon) |
| 9867 : super(comment, metadata, keyword, libraryUri, configurations, | 9586 : super(comment, metadata, keyword, libraryUri, configurations, |
| 9868 combinators, semicolon) { | 9587 combinators, semicolon) { |
| 9869 _prefix = _becomeParentOf(prefix); | 9588 _prefix = _becomeParentOf(prefix); |
| 9870 } | 9589 } |
| 9871 | 9590 |
| 9872 /** | |
| 9873 * The token representing the 'as' token, or `null` if the imported names are | |
| 9874 * not prefixed. | |
| 9875 */ | |
| 9876 @deprecated // Use "this.asKeyword" | |
| 9877 Token get asToken => asKeyword; | |
| 9878 | |
| 9879 /** | |
| 9880 * The token representing the 'as' token to the given token. | |
| 9881 */ | |
| 9882 @deprecated // Use "this.asKeyword" | |
| 9883 set asToken(Token token) { | |
| 9884 asKeyword = token; | |
| 9885 } | |
| 9886 | |
| 9887 @override | 9591 @override |
| 9888 Iterable get childEntities => super._childEntities | 9592 Iterable get childEntities => super._childEntities |
| 9889 ..add(_uri) | 9593 ..add(_uri) |
| 9890 ..add(deferredKeyword) | 9594 ..add(deferredKeyword) |
| 9891 ..add(asKeyword) | 9595 ..add(asKeyword) |
| 9892 ..add(_prefix) | 9596 ..add(_prefix) |
| 9893 ..addAll(combinators) | 9597 ..addAll(combinators) |
| 9894 ..add(semicolon); | 9598 ..add(semicolon); |
| 9895 | 9599 |
| 9896 /** | |
| 9897 * Return the token representing the 'deferred' token, or `null` if the | |
| 9898 * imported is not deferred. | |
| 9899 */ | |
| 9900 @deprecated // Use "this.deferredKeyword" | |
| 9901 Token get deferredToken => deferredKeyword; | |
| 9902 | |
| 9903 /** | |
| 9904 * Set the token representing the 'deferred' token to the given token. | |
| 9905 */ | |
| 9906 @deprecated // Use "this.deferredKeyword" | |
| 9907 set deferredToken(Token token) { | |
| 9908 deferredKeyword = token; | |
| 9909 } | |
| 9910 | |
| 9911 @override | 9600 @override |
| 9912 ImportElement get element => super.element as ImportElement; | 9601 ImportElement get element => super.element as ImportElement; |
| 9913 | 9602 |
| 9914 /** | 9603 /** |
| 9915 * Return the prefix to be used with the imported names, or `null` if the | 9604 * Return the prefix to be used with the imported names, or `null` if the |
| 9916 * imported names are not prefixed. | 9605 * imported names are not prefixed. |
| 9917 */ | 9606 */ |
| 9918 SimpleIdentifier get prefix => _prefix; | 9607 SimpleIdentifier get prefix => _prefix; |
| 9919 | 9608 |
| 9920 /** | 9609 /** |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11129 * Return `true` if this expression is cascaded. If it is, then the target of | 10818 * Return `true` if this expression is cascaded. If it is, then the target of |
| 11130 * this expression is not stored locally but is stored in the nearest ancestor | 10819 * this expression is not stored locally but is stored in the nearest ancestor |
| 11131 * that is a [CascadeExpression]. | 10820 * that is a [CascadeExpression]. |
| 11132 */ | 10821 */ |
| 11133 bool get isCascaded => period != null; | 10822 bool get isCascaded => period != null; |
| 11134 | 10823 |
| 11135 @override | 10824 @override |
| 11136 int get precedence => 15; | 10825 int get precedence => 15; |
| 11137 | 10826 |
| 11138 /** | 10827 /** |
| 11139 * If the AST structure has been resolved, and the function being invoked is | |
| 11140 * known based on propagated type information, then return the parameter | |
| 11141 * element representing the parameter to which the value of the index | |
| 11142 * expression will be bound. Otherwise, return `null`. | |
| 11143 */ | |
| 11144 @deprecated // Use "expression.propagatedParameterElement" | |
| 11145 ParameterElement get propagatedParameterElementForIndex { | |
| 11146 return _propagatedParameterElementForIndex; | |
| 11147 } | |
| 11148 | |
| 11149 /** | |
| 11150 * Return the expression used to compute the object being indexed. If this | 10828 * Return the expression used to compute the object being indexed. If this |
| 11151 * index expression is not part of a cascade expression, then this is the same | 10829 * index expression is not part of a cascade expression, then this is the same |
| 11152 * as [target]. If this index expression is part of a cascade expression, then | 10830 * as [target]. If this index expression is part of a cascade expression, then |
| 11153 * the target expression stored with the cascade expression is returned. | 10831 * the target expression stored with the cascade expression is returned. |
| 11154 */ | 10832 */ |
| 11155 Expression get realTarget { | 10833 Expression get realTarget { |
| 11156 if (isCascaded) { | 10834 if (isCascaded) { |
| 11157 AstNode ancestor = parent; | 10835 AstNode ancestor = parent; |
| 11158 while (ancestor is! CascadeExpression) { | 10836 while (ancestor is! CascadeExpression) { |
| 11159 if (ancestor == null) { | 10837 if (ancestor == null) { |
| 11160 return _target; | 10838 return _target; |
| 11161 } | 10839 } |
| 11162 ancestor = ancestor.parent; | 10840 ancestor = ancestor.parent; |
| 11163 } | 10841 } |
| 11164 return (ancestor as CascadeExpression).target; | 10842 return (ancestor as CascadeExpression).target; |
| 11165 } | 10843 } |
| 11166 return _target; | 10844 return _target; |
| 11167 } | 10845 } |
| 11168 | 10846 |
| 11169 /** | 10847 /** |
| 11170 * If the AST structure has been resolved, and the function being invoked is | |
| 11171 * known based on static type information, then return the parameter element | |
| 11172 * representing the parameter to which the value of the index expression will | |
| 11173 * be bound. Otherwise, return `null`. | |
| 11174 */ | |
| 11175 @deprecated // Use "expression.propagatedParameterElement" | |
| 11176 ParameterElement get staticParameterElementForIndex { | |
| 11177 return _staticParameterElementForIndex; | |
| 11178 } | |
| 11179 | |
| 11180 /** | |
| 11181 * Return the expression used to compute the object being indexed, or `null` | 10848 * Return the expression used to compute the object being indexed, or `null` |
| 11182 * if this index expression is part of a cascade expression. | 10849 * if this index expression is part of a cascade expression. |
| 11183 * | 10850 * |
| 11184 * Use [realTarget] to get the target independent of whether this is part of a | 10851 * Use [realTarget] to get the target independent of whether this is part of a |
| 11185 * cascade expression. | 10852 * cascade expression. |
| 11186 */ | 10853 */ |
| 11187 Expression get target => _target; | 10854 Expression get target => _target; |
| 11188 | 10855 |
| 11189 /** | 10856 /** |
| 11190 * Set the expression used to compute the object being indexed to the given | 10857 * Set the expression used to compute the object being indexed to the given |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11818 @override | 11485 @override |
| 11819 Token get endToken => semicolon; | 11486 Token get endToken => semicolon; |
| 11820 | 11487 |
| 11821 @override | 11488 @override |
| 11822 Token get firstTokenAfterCommentAndMetadata => libraryKeyword; | 11489 Token get firstTokenAfterCommentAndMetadata => libraryKeyword; |
| 11823 | 11490 |
| 11824 @override | 11491 @override |
| 11825 Token get keyword => libraryKeyword; | 11492 Token get keyword => libraryKeyword; |
| 11826 | 11493 |
| 11827 /** | 11494 /** |
| 11828 * Return the token representing the 'library' token. | |
| 11829 */ | |
| 11830 @deprecated // Use "this.libraryKeyword" | |
| 11831 Token get libraryToken => libraryKeyword; | |
| 11832 | |
| 11833 /** | |
| 11834 * Set the token representing the 'library' token to the given [token]. | |
| 11835 */ | |
| 11836 @deprecated // Use "this.libraryKeyword" | |
| 11837 set libraryToken(Token token) { | |
| 11838 libraryKeyword = token; | |
| 11839 } | |
| 11840 | |
| 11841 /** | |
| 11842 * Return the name of the library being defined. | 11495 * Return the name of the library being defined. |
| 11843 */ | 11496 */ |
| 11844 LibraryIdentifier get name => _name; | 11497 LibraryIdentifier get name => _name; |
| 11845 | 11498 |
| 11846 /** | 11499 /** |
| 11847 * Set the name of the library being defined to the given [name]. | 11500 * Set the name of the library being defined to the given [name]. |
| 11848 */ | 11501 */ |
| 11849 void set name(LibraryIdentifier name) { | 11502 void set name(LibraryIdentifier name) { |
| 11850 _name = _becomeParentOf(name); | 11503 _name = _becomeParentOf(name); |
| 11851 } | 11504 } |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12515 */ | 12168 */ |
| 12516 SimpleIdentifier get methodName => _methodName; | 12169 SimpleIdentifier get methodName => _methodName; |
| 12517 | 12170 |
| 12518 /** | 12171 /** |
| 12519 * Set the name of the method being invoked to the given [identifier]. | 12172 * Set the name of the method being invoked to the given [identifier]. |
| 12520 */ | 12173 */ |
| 12521 void set methodName(SimpleIdentifier identifier) { | 12174 void set methodName(SimpleIdentifier identifier) { |
| 12522 _methodName = _becomeParentOf(identifier); | 12175 _methodName = _becomeParentOf(identifier); |
| 12523 } | 12176 } |
| 12524 | 12177 |
| 12525 /** | |
| 12526 * The operator that separates the target from the method name, or `null` | |
| 12527 * if there is no target. In an ordinary method invocation this will be a | |
| 12528 * period ('.'). In a cascade section this will be the cascade operator | |
| 12529 * ('..'). | |
| 12530 */ | |
| 12531 @deprecated // Use this.operator | |
| 12532 Token get period => operator; | |
| 12533 | |
| 12534 /** | |
| 12535 * The operator that separates the target from the method name, or `null` | |
| 12536 * if there is no target. In an ordinary method invocation this will be a | |
| 12537 * period ('.'). In a cascade section this will be the cascade operator | |
| 12538 * ('..'). | |
| 12539 */ | |
| 12540 @deprecated // Use this.operator | |
| 12541 void set period(Token value) { | |
| 12542 operator = value; | |
| 12543 } | |
| 12544 | |
| 12545 @override | 12178 @override |
| 12546 int get precedence => 15; | 12179 int get precedence => 15; |
| 12547 | 12180 |
| 12548 /** | 12181 /** |
| 12549 * Return the expression used to compute the receiver of the invocation. If | 12182 * Return the expression used to compute the receiver of the invocation. If |
| 12550 * this invocation is not part of a cascade expression, then this is the same | 12183 * this invocation is not part of a cascade expression, then this is the same |
| 12551 * as [target]. If this invocation is part of a cascade expression, then the | 12184 * as [target]. If this invocation is part of a cascade expression, then the |
| 12552 * target stored with the cascade expression is returned. | 12185 * target stored with the cascade expression is returned. |
| 12553 */ | 12186 */ |
| 12554 Expression get realTarget { | 12187 Expression get realTarget { |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12826 Token get beginToken => nativeKeyword; | 12459 Token get beginToken => nativeKeyword; |
| 12827 | 12460 |
| 12828 @override | 12461 @override |
| 12829 Iterable get childEntities => | 12462 Iterable get childEntities => |
| 12830 new ChildEntities()..add(nativeKeyword)..add(_name); | 12463 new ChildEntities()..add(nativeKeyword)..add(_name); |
| 12831 | 12464 |
| 12832 @override | 12465 @override |
| 12833 Token get endToken => _name.endToken; | 12466 Token get endToken => _name.endToken; |
| 12834 | 12467 |
| 12835 /** | 12468 /** |
| 12836 * Get the token representing the 'native' keyword. | |
| 12837 */ | |
| 12838 @deprecated // Use "this.nativeKeyword" | |
| 12839 Token get keyword => nativeKeyword; | |
| 12840 | |
| 12841 /** | |
| 12842 * Set the token representing the 'native' keyword to the given [token]. | |
| 12843 */ | |
| 12844 @deprecated // Use "this.nativeKeyword" | |
| 12845 set keyword(Token token) { | |
| 12846 nativeKeyword = token; | |
| 12847 } | |
| 12848 | |
| 12849 /** | |
| 12850 * Return the name of the native object that implements the class. | 12469 * Return the name of the native object that implements the class. |
| 12851 */ | 12470 */ |
| 12852 StringLiteral get name => _name; | 12471 StringLiteral get name => _name; |
| 12853 | 12472 |
| 12854 /** | 12473 /** |
| 12855 * Set the name of the native object that implements the class to the given | 12474 * Set the name of the native object that implements the class to the given |
| 12856 * [name]. | 12475 * [name]. |
| 12857 */ | 12476 */ |
| 12858 void set name(StringLiteral name) { | 12477 void set name(StringLiteral name) { |
| 12859 _name = _becomeParentOf(name); | 12478 _name = _becomeParentOf(name); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12907 @override | 12526 @override |
| 12908 Iterable get childEntities => new ChildEntities() | 12527 Iterable get childEntities => new ChildEntities() |
| 12909 ..add(nativeKeyword) | 12528 ..add(nativeKeyword) |
| 12910 ..add(_stringLiteral) | 12529 ..add(_stringLiteral) |
| 12911 ..add(semicolon); | 12530 ..add(semicolon); |
| 12912 | 12531 |
| 12913 @override | 12532 @override |
| 12914 Token get endToken => semicolon; | 12533 Token get endToken => semicolon; |
| 12915 | 12534 |
| 12916 /** | 12535 /** |
| 12917 * Return the token representing 'native' that marks the start of the function | |
| 12918 * body. | |
| 12919 */ | |
| 12920 @deprecated // Use "this.nativeKeyword" | |
| 12921 Token get nativeToken => nativeKeyword; | |
| 12922 | |
| 12923 /** | |
| 12924 * Set the token representing 'native' that marks the start of the function | |
| 12925 * body to the given [token]. | |
| 12926 */ | |
| 12927 @deprecated // Use "this.nativeKeyword" | |
| 12928 set nativeToken(Token token) { | |
| 12929 nativeKeyword = token; | |
| 12930 } | |
| 12931 | |
| 12932 /** | |
| 12933 * Return the string literal representing the string after the 'native' token. | 12536 * Return the string literal representing the string after the 'native' token. |
| 12934 */ | 12537 */ |
| 12935 StringLiteral get stringLiteral => _stringLiteral; | 12538 StringLiteral get stringLiteral => _stringLiteral; |
| 12936 | 12539 |
| 12937 /** | 12540 /** |
| 12938 * Set the string literal representing the string after the 'native' token to | 12541 * Set the string literal representing the string after the 'native' token to |
| 12939 * the given [stringLiteral]. | 12542 * the given [stringLiteral]. |
| 12940 */ | 12543 */ |
| 12941 void set stringLiteral(StringLiteral stringLiteral) { | 12544 void set stringLiteral(StringLiteral stringLiteral) { |
| 12942 _stringLiteral = _becomeParentOf(stringLiteral); | 12545 _stringLiteral = _becomeParentOf(stringLiteral); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12993 int length = _elements.length; | 12596 int length = _elements.length; |
| 12994 if (length == 0) { | 12597 if (length == 0) { |
| 12995 return null; | 12598 return null; |
| 12996 } | 12599 } |
| 12997 return _elements[length - 1].endToken; | 12600 return _elements[length - 1].endToken; |
| 12998 } | 12601 } |
| 12999 | 12602 |
| 13000 int get length => _elements.length; | 12603 int get length => _elements.length; |
| 13001 | 12604 |
| 13002 @deprecated // Never intended for public use. | 12605 @deprecated // Never intended for public use. |
| 13003 void set length(int value) { | 12606 @override |
| 12607 void set length(int newLength) { |
| 13004 throw new UnsupportedError("Cannot resize NodeList."); | 12608 throw new UnsupportedError("Cannot resize NodeList."); |
| 13005 } | 12609 } |
| 13006 | 12610 |
| 13007 E operator [](int index) { | 12611 E operator [](int index) { |
| 13008 if (index < 0 || index >= _elements.length) { | 12612 if (index < 0 || index >= _elements.length) { |
| 13009 throw new RangeError("Index: $index, Size: ${_elements.length}"); | 12613 throw new RangeError("Index: $index, Size: ${_elements.length}"); |
| 13010 } | 12614 } |
| 13011 return _elements[index]; | 12615 return _elements[index]; |
| 13012 } | 12616 } |
| 13013 | 12617 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13067 | 12671 |
| 13068 @override | 12672 @override |
| 13069 E removeAt(int index) { | 12673 E removeAt(int index) { |
| 13070 if (index < 0 || index >= _elements.length) { | 12674 if (index < 0 || index >= _elements.length) { |
| 13071 throw new RangeError("Index: $index, Size: ${_elements.length}"); | 12675 throw new RangeError("Index: $index, Size: ${_elements.length}"); |
| 13072 } | 12676 } |
| 13073 E removedNode = _elements[index]; | 12677 E removedNode = _elements[index]; |
| 13074 _elements.removeAt(index); | 12678 _elements.removeAt(index); |
| 13075 return removedNode; | 12679 return removedNode; |
| 13076 } | 12680 } |
| 13077 | |
| 13078 /** | |
| 13079 * Create an empty list with the given [owner]. | |
| 13080 */ | |
| 13081 @deprecated // Use "new NodeList<E>(owner)" | |
| 13082 static NodeList create(AstNode owner) => new NodeList(owner); | |
| 13083 } | 12681 } |
| 13084 | 12682 |
| 13085 /** | 12683 /** |
| 13086 * An object used to locate the [AstNode] associated with a source range, given | 12684 * An object used to locate the [AstNode] associated with a source range, given |
| 13087 * the AST structure built from the source. More specifically, they will return | 12685 * the AST structure built from the source. More specifically, they will return |
| 13088 * the [AstNode] with the shortest length whose source range completely | 12686 * the [AstNode] with the shortest length whose source range completely |
| 13089 * encompasses the specified range. | 12687 * encompasses the specified range. |
| 13090 */ | 12688 */ |
| 13091 class NodeLocator extends UnifyingAstVisitor<Object> { | 12689 class NodeLocator extends UnifyingAstVisitor<Object> { |
| 13092 /** | 12690 /** |
| (...skipping 15 matching lines...) Expand all Loading... |
| 13108 /** | 12706 /** |
| 13109 * Initialize a newly created locator to locate an [AstNode] by locating the | 12707 * Initialize a newly created locator to locate an [AstNode] by locating the |
| 13110 * node within an AST structure that corresponds to the given range of | 12708 * node within an AST structure that corresponds to the given range of |
| 13111 * characters (between the [startOffset] and [endOffset] in the source. | 12709 * characters (between the [startOffset] and [endOffset] in the source. |
| 13112 */ | 12710 */ |
| 13113 NodeLocator(int startOffset, [int endOffset]) | 12711 NodeLocator(int startOffset, [int endOffset]) |
| 13114 : this._startOffset = startOffset, | 12712 : this._startOffset = startOffset, |
| 13115 this._endOffset = endOffset == null ? startOffset : endOffset; | 12713 this._endOffset = endOffset == null ? startOffset : endOffset; |
| 13116 | 12714 |
| 13117 /** | 12715 /** |
| 13118 * Initialize a newly created locator to locate an [AstNode] by locating the | |
| 13119 * node within an AST structure that corresponds to the given [offset] in the | |
| 13120 * source. | |
| 13121 */ | |
| 13122 @deprecated // Use new NodeLocator(offset) | |
| 13123 NodeLocator.con1(int offset) : this(offset); | |
| 13124 | |
| 13125 /** | |
| 13126 * Initialize a newly created locator to locate an [AstNode] by locating the | |
| 13127 * node within an AST structure that corresponds to the given range of | |
| 13128 * characters (between the [startOffset] and [endOffset] in the source. | |
| 13129 */ | |
| 13130 @deprecated // Use new NodeLocator(startOffset, endOffset) | |
| 13131 NodeLocator.con2(this._startOffset, this._endOffset); | |
| 13132 | |
| 13133 /** | |
| 13134 * Return the node that was found that corresponds to the given source range | 12716 * Return the node that was found that corresponds to the given source range |
| 13135 * or `null` if there is no such node. | 12717 * or `null` if there is no such node. |
| 13136 */ | 12718 */ |
| 13137 AstNode get foundNode => _foundNode; | 12719 AstNode get foundNode => _foundNode; |
| 13138 | 12720 |
| 13139 /** | 12721 /** |
| 13140 * Search within the given AST [node] for an identifier representing an | 12722 * Search within the given AST [node] for an identifier representing an |
| 13141 * element in the specified source range. Return the element that was found, | 12723 * element in the specified source range. Return the element that was found, |
| 13142 * or `null` if no element was found. | 12724 * or `null` if no element was found. |
| 13143 */ | 12725 */ |
| (...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14749 | 14331 |
| 14750 @override | 14332 @override |
| 14751 Token get endToken => semicolon; | 14333 Token get endToken => semicolon; |
| 14752 | 14334 |
| 14753 @override | 14335 @override |
| 14754 Token get firstTokenAfterCommentAndMetadata => partKeyword; | 14336 Token get firstTokenAfterCommentAndMetadata => partKeyword; |
| 14755 | 14337 |
| 14756 @override | 14338 @override |
| 14757 Token get keyword => partKeyword; | 14339 Token get keyword => partKeyword; |
| 14758 | 14340 |
| 14759 /** | |
| 14760 * Return the token representing the 'part' token. | |
| 14761 */ | |
| 14762 @deprecated // Use "this.partKeyword" | |
| 14763 Token get partToken => partKeyword; | |
| 14764 | |
| 14765 /** | |
| 14766 * Set the token representing the 'part' token to the given [token]. | |
| 14767 */ | |
| 14768 @deprecated // Use "this.partKeyword" | |
| 14769 set partToken(Token token) { | |
| 14770 partKeyword = token; | |
| 14771 } | |
| 14772 | |
| 14773 @override | 14341 @override |
| 14774 CompilationUnitElement get uriElement => element as CompilationUnitElement; | 14342 CompilationUnitElement get uriElement => element as CompilationUnitElement; |
| 14775 | 14343 |
| 14776 @override | 14344 @override |
| 14777 accept(AstVisitor visitor) => visitor.visitPartDirective(this); | 14345 accept(AstVisitor visitor) => visitor.visitPartDirective(this); |
| 14778 } | 14346 } |
| 14779 | 14347 |
| 14780 /** | 14348 /** |
| 14781 * A part-of directive. | 14349 * A part-of directive. |
| 14782 * | 14350 * |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14838 LibraryIdentifier get libraryName => _libraryName; | 14406 LibraryIdentifier get libraryName => _libraryName; |
| 14839 | 14407 |
| 14840 /** | 14408 /** |
| 14841 * Set the name of the library that the containing compilation unit is part of | 14409 * Set the name of the library that the containing compilation unit is part of |
| 14842 * to the given [libraryName]. | 14410 * to the given [libraryName]. |
| 14843 */ | 14411 */ |
| 14844 void set libraryName(LibraryIdentifier libraryName) { | 14412 void set libraryName(LibraryIdentifier libraryName) { |
| 14845 _libraryName = _becomeParentOf(libraryName); | 14413 _libraryName = _becomeParentOf(libraryName); |
| 14846 } | 14414 } |
| 14847 | 14415 |
| 14848 /** | |
| 14849 * Return the token representing the 'of' token. | |
| 14850 */ | |
| 14851 @deprecated // Use "this.ofKeyword" | |
| 14852 Token get ofToken => ofKeyword; | |
| 14853 | |
| 14854 /** | |
| 14855 * Set the token representing the 'of' token to the given [token]. | |
| 14856 */ | |
| 14857 @deprecated // Use "this.ofKeyword" | |
| 14858 set ofToken(Token token) { | |
| 14859 ofKeyword = token; | |
| 14860 } | |
| 14861 | |
| 14862 /** | |
| 14863 * Return the token representing the 'part' token. | |
| 14864 */ | |
| 14865 @deprecated // Use "this.partKeyword" | |
| 14866 Token get partToken => partKeyword; | |
| 14867 | |
| 14868 /** | |
| 14869 * Set the token representing the 'part' token to the given [token]. | |
| 14870 */ | |
| 14871 @deprecated // Use "this.partKeyword" | |
| 14872 set partToken(Token token) { | |
| 14873 partKeyword = token; | |
| 14874 } | |
| 14875 | |
| 14876 @override | 14416 @override |
| 14877 accept(AstVisitor visitor) => visitor.visitPartOfDirective(this); | 14417 accept(AstVisitor visitor) => visitor.visitPartOfDirective(this); |
| 14878 | 14418 |
| 14879 @override | 14419 @override |
| 14880 void visitChildren(AstVisitor visitor) { | 14420 void visitChildren(AstVisitor visitor) { |
| 14881 super.visitChildren(visitor); | 14421 super.visitChildren(visitor); |
| 14882 _safelyVisitChild(_libraryName, visitor); | 14422 _safelyVisitChild(_libraryName, visitor); |
| 14883 } | 14423 } |
| 14884 } | 14424 } |
| 14885 | 14425 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14962 | 14502 |
| 14963 @override | 14503 @override |
| 14964 int get precedence => 15; | 14504 int get precedence => 15; |
| 14965 | 14505 |
| 14966 /** | 14506 /** |
| 14967 * If the AST structure has been resolved, and the function being invoked is | 14507 * If the AST structure has been resolved, and the function being invoked is |
| 14968 * known based on propagated type information, then return the parameter | 14508 * known based on propagated type information, then return the parameter |
| 14969 * element representing the parameter to which the value of the operand will | 14509 * element representing the parameter to which the value of the operand will |
| 14970 * be bound. Otherwise, return `null`. | 14510 * be bound. Otherwise, return `null`. |
| 14971 */ | 14511 */ |
| 14972 @deprecated // Use "expression.propagatedParameterElement" | |
| 14973 ParameterElement get propagatedParameterElementForOperand { | |
| 14974 return _propagatedParameterElementForOperand; | |
| 14975 } | |
| 14976 | |
| 14977 /** | |
| 14978 * If the AST structure has been resolved, and the function being invoked is | |
| 14979 * known based on static type information, then return the parameter element | |
| 14980 * representing the parameter to which the value of the operand will be bound. | |
| 14981 * Otherwise, return `null`. | |
| 14982 */ | |
| 14983 @deprecated // Use "expression.propagatedParameterElement" | |
| 14984 ParameterElement get staticParameterElementForOperand { | |
| 14985 return _staticParameterElementForOperand; | |
| 14986 } | |
| 14987 | |
| 14988 /** | |
| 14989 * If the AST structure has been resolved, and the function being invoked is | |
| 14990 * known based on propagated type information, then return the parameter | |
| 14991 * element representing the parameter to which the value of the operand will | |
| 14992 * be bound. Otherwise, return `null`. | |
| 14993 */ | |
| 14994 ParameterElement get _propagatedParameterElementForOperand { | 14512 ParameterElement get _propagatedParameterElementForOperand { |
| 14995 if (propagatedElement == null) { | 14513 if (propagatedElement == null) { |
| 14996 return null; | 14514 return null; |
| 14997 } | 14515 } |
| 14998 List<ParameterElement> parameters = propagatedElement.parameters; | 14516 List<ParameterElement> parameters = propagatedElement.parameters; |
| 14999 if (parameters.length < 1) { | 14517 if (parameters.length < 1) { |
| 15000 return null; | 14518 return null; |
| 15001 } | 14519 } |
| 15002 return parameters[0]; | 14520 return parameters[0]; |
| 15003 } | 14521 } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15235 | 14753 |
| 15236 @override | 14754 @override |
| 15237 int get precedence => 14; | 14755 int get precedence => 14; |
| 15238 | 14756 |
| 15239 /** | 14757 /** |
| 15240 * If the AST structure has been resolved, and the function being invoked is | 14758 * If the AST structure has been resolved, and the function being invoked is |
| 15241 * known based on propagated type information, then return the parameter | 14759 * known based on propagated type information, then return the parameter |
| 15242 * element representing the parameter to which the value of the operand will | 14760 * element representing the parameter to which the value of the operand will |
| 15243 * be bound. Otherwise, return `null`. | 14761 * be bound. Otherwise, return `null`. |
| 15244 */ | 14762 */ |
| 15245 @deprecated // Use "expression.propagatedParameterElement" | |
| 15246 ParameterElement get propagatedParameterElementForOperand { | |
| 15247 return _propagatedParameterElementForOperand; | |
| 15248 } | |
| 15249 | |
| 15250 /** | |
| 15251 * If the AST structure has been resolved, and the function being invoked is | |
| 15252 * known based on static type information, then return the parameter element | |
| 15253 * representing the parameter to which the value of the operand will be bound. | |
| 15254 * Otherwise, return `null`. | |
| 15255 */ | |
| 15256 @deprecated // Use "expression.propagatedParameterElement" | |
| 15257 ParameterElement get staticParameterElementForOperand { | |
| 15258 return _staticParameterElementForOperand; | |
| 15259 } | |
| 15260 | |
| 15261 /** | |
| 15262 * If the AST structure has been resolved, and the function being invoked is | |
| 15263 * known based on propagated type information, then return the parameter | |
| 15264 * element representing the parameter to which the value of the operand will | |
| 15265 * be bound. Otherwise, return `null`. | |
| 15266 */ | |
| 15267 ParameterElement get _propagatedParameterElementForOperand { | 14763 ParameterElement get _propagatedParameterElementForOperand { |
| 15268 if (propagatedElement == null) { | 14764 if (propagatedElement == null) { |
| 15269 return null; | 14765 return null; |
| 15270 } | 14766 } |
| 15271 List<ParameterElement> parameters = propagatedElement.parameters; | 14767 List<ParameterElement> parameters = propagatedElement.parameters; |
| 15272 if (parameters.length < 1) { | 14768 if (parameters.length < 1) { |
| 15273 return null; | 14769 return null; |
| 15274 } | 14770 } |
| 15275 return parameters[0]; | 14771 return parameters[0]; |
| 15276 } | 14772 } |
| (...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16165 * Set the name of the constructor that is being invoked to the given | 15661 * Set the name of the constructor that is being invoked to the given |
| 16166 * [identifier]. | 15662 * [identifier]. |
| 16167 */ | 15663 */ |
| 16168 void set constructorName(SimpleIdentifier identifier) { | 15664 void set constructorName(SimpleIdentifier identifier) { |
| 16169 _constructorName = _becomeParentOf(identifier); | 15665 _constructorName = _becomeParentOf(identifier); |
| 16170 } | 15666 } |
| 16171 | 15667 |
| 16172 @override | 15668 @override |
| 16173 Token get endToken => _argumentList.endToken; | 15669 Token get endToken => _argumentList.endToken; |
| 16174 | 15670 |
| 16175 /** | |
| 16176 * Return the token for the 'this' keyword. | |
| 16177 */ | |
| 16178 @deprecated // Use "this.thisKeyword" | |
| 16179 Token get keyword => thisKeyword; | |
| 16180 | |
| 16181 /** | |
| 16182 * Set the token for the 'this' keyword to the given [token]. | |
| 16183 */ | |
| 16184 @deprecated // Use "this.thisKeyword" | |
| 16185 set keyword(Token token) { | |
| 16186 thisKeyword = token; | |
| 16187 } | |
| 16188 | |
| 16189 @override | 15671 @override |
| 16190 accept(AstVisitor visitor) => | 15672 accept(AstVisitor visitor) => |
| 16191 visitor.visitRedirectingConstructorInvocation(this); | 15673 visitor.visitRedirectingConstructorInvocation(this); |
| 16192 | 15674 |
| 16193 @override | 15675 @override |
| 16194 void visitChildren(AstVisitor visitor) { | 15676 void visitChildren(AstVisitor visitor) { |
| 16195 _safelyVisitChild(_constructorName, visitor); | 15677 _safelyVisitChild(_constructorName, visitor); |
| 16196 _safelyVisitChild(_argumentList, visitor); | 15678 _safelyVisitChild(_argumentList, visitor); |
| 16197 } | 15679 } |
| 16198 } | 15680 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 16216 | 15698 |
| 16217 @override | 15699 @override |
| 16218 Token get beginToken => rethrowKeyword; | 15700 Token get beginToken => rethrowKeyword; |
| 16219 | 15701 |
| 16220 @override | 15702 @override |
| 16221 Iterable get childEntities => new ChildEntities()..add(rethrowKeyword); | 15703 Iterable get childEntities => new ChildEntities()..add(rethrowKeyword); |
| 16222 | 15704 |
| 16223 @override | 15705 @override |
| 16224 Token get endToken => rethrowKeyword; | 15706 Token get endToken => rethrowKeyword; |
| 16225 | 15707 |
| 16226 /** | |
| 16227 * Return the token representing the 'rethrow' keyword. | |
| 16228 */ | |
| 16229 @deprecated // Use "this.rethrowKeyword" | |
| 16230 Token get keyword => rethrowKeyword; | |
| 16231 | |
| 16232 /** | |
| 16233 * Set the token representing the 'rethrow' keyword to the given [token]. | |
| 16234 */ | |
| 16235 @deprecated // Use "this.rethrowKeyword" | |
| 16236 set keyword(Token token) { | |
| 16237 rethrowKeyword = token; | |
| 16238 } | |
| 16239 | |
| 16240 @override | 15708 @override |
| 16241 int get precedence => 0; | 15709 int get precedence => 0; |
| 16242 | 15710 |
| 16243 @override | 15711 @override |
| 16244 accept(AstVisitor visitor) => visitor.visitRethrowExpression(this); | 15712 accept(AstVisitor visitor) => visitor.visitRethrowExpression(this); |
| 16245 | 15713 |
| 16246 @override | 15714 @override |
| 16247 void visitChildren(AstVisitor visitor) { | 15715 void visitChildren(AstVisitor visitor) { |
| 16248 // There are no children to visit. | 15716 // There are no children to visit. |
| 16249 } | 15717 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16297 Expression get expression => _expression; | 15765 Expression get expression => _expression; |
| 16298 | 15766 |
| 16299 /** | 15767 /** |
| 16300 * Set the expression computing the value to be returned to the given | 15768 * Set the expression computing the value to be returned to the given |
| 16301 * [expression]. | 15769 * [expression]. |
| 16302 */ | 15770 */ |
| 16303 void set expression(Expression expression) { | 15771 void set expression(Expression expression) { |
| 16304 _expression = _becomeParentOf(expression); | 15772 _expression = _becomeParentOf(expression); |
| 16305 } | 15773 } |
| 16306 | 15774 |
| 16307 /** | |
| 16308 * Return the token representing the 'return' keyword. | |
| 16309 */ | |
| 16310 @deprecated // Use "this.returnKeyword" | |
| 16311 Token get keyword => returnKeyword; | |
| 16312 | |
| 16313 /** | |
| 16314 * Set the token representing the 'return' keyword to the given [token]. | |
| 16315 */ | |
| 16316 @deprecated // Use "this.returnKeyword" | |
| 16317 set keyword(Token token) { | |
| 16318 returnKeyword = token; | |
| 16319 } | |
| 16320 | |
| 16321 @override | 15775 @override |
| 16322 accept(AstVisitor visitor) => visitor.visitReturnStatement(this); | 15776 accept(AstVisitor visitor) => visitor.visitReturnStatement(this); |
| 16323 | 15777 |
| 16324 @override | 15778 @override |
| 16325 void visitChildren(AstVisitor visitor) { | 15779 void visitChildren(AstVisitor visitor) { |
| 16326 _safelyVisitChild(_expression, visitor); | 15780 _safelyVisitChild(_expression, visitor); |
| 16327 } | 15781 } |
| 16328 } | 15782 } |
| 16329 | 15783 |
| 16330 /** | 15784 /** |
| (...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17351 * The token representing the literal. | 16805 * The token representing the literal. |
| 17352 */ | 16806 */ |
| 17353 Token literal; | 16807 Token literal; |
| 17354 | 16808 |
| 17355 /** | 16809 /** |
| 17356 * The value of the literal. | 16810 * The value of the literal. |
| 17357 */ | 16811 */ |
| 17358 String _value; | 16812 String _value; |
| 17359 | 16813 |
| 17360 /** | 16814 /** |
| 17361 * The toolkit specific element associated with this literal, or `null`. | |
| 17362 */ | |
| 17363 @deprecated // No replacement | |
| 17364 Element toolkitElement; | |
| 17365 | |
| 17366 /** | |
| 17367 * Initialize a newly created simple string literal. | 16815 * Initialize a newly created simple string literal. |
| 17368 */ | 16816 */ |
| 17369 SimpleStringLiteral(this.literal, String value) { | 16817 SimpleStringLiteral(this.literal, String value) { |
| 17370 _value = StringUtilities.intern(value); | 16818 _value = StringUtilities.intern(value); |
| 17371 } | 16819 } |
| 17372 | 16820 |
| 17373 @override | 16821 @override |
| 17374 Token get beginToken => literal; | 16822 Token get beginToken => literal; |
| 17375 | 16823 |
| 17376 @override | 16824 @override |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17681 return null; | 17129 return null; |
| 17682 } | 17130 } |
| 17683 return buffer.toString(); | 17131 return buffer.toString(); |
| 17684 } | 17132 } |
| 17685 | 17133 |
| 17686 /** | 17134 /** |
| 17687 * Append the value of this string literal to the given [buffer]. Throw an | 17135 * Append the value of this string literal to the given [buffer]. Throw an |
| 17688 * [IllegalArgumentException] if the string is not a constant string without | 17136 * [IllegalArgumentException] if the string is not a constant string without |
| 17689 * any string interpolation. | 17137 * any string interpolation. |
| 17690 */ | 17138 */ |
| 17691 @deprecated // Use "this.stringValue" | |
| 17692 void appendStringValue(StringBuffer buffer) => _appendStringValue(buffer); | |
| 17693 | |
| 17694 /** | |
| 17695 * Append the value of this string literal to the given [buffer]. Throw an | |
| 17696 * [IllegalArgumentException] if the string is not a constant string without | |
| 17697 * any string interpolation. | |
| 17698 */ | |
| 17699 void _appendStringValue(StringBuffer buffer); | 17139 void _appendStringValue(StringBuffer buffer); |
| 17700 } | 17140 } |
| 17701 | 17141 |
| 17702 /** | 17142 /** |
| 17703 * The invocation of a superclass' constructor from within a constructor's | 17143 * The invocation of a superclass' constructor from within a constructor's |
| 17704 * initialization list. | 17144 * initialization list. |
| 17705 * | 17145 * |
| 17706 * > superInvocation ::= | 17146 * > superInvocation ::= |
| 17707 * > 'super' ('.' [SimpleIdentifier])? [ArgumentList] | 17147 * > 'super' ('.' [SimpleIdentifier])? [ArgumentList] |
| 17708 */ | 17148 */ |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17780 * Set the name of the constructor that is being invoked to the given | 17220 * Set the name of the constructor that is being invoked to the given |
| 17781 * [identifier]. | 17221 * [identifier]. |
| 17782 */ | 17222 */ |
| 17783 void set constructorName(SimpleIdentifier identifier) { | 17223 void set constructorName(SimpleIdentifier identifier) { |
| 17784 _constructorName = _becomeParentOf(identifier); | 17224 _constructorName = _becomeParentOf(identifier); |
| 17785 } | 17225 } |
| 17786 | 17226 |
| 17787 @override | 17227 @override |
| 17788 Token get endToken => _argumentList.endToken; | 17228 Token get endToken => _argumentList.endToken; |
| 17789 | 17229 |
| 17790 /** | |
| 17791 * Return the token for the 'super' keyword. | |
| 17792 */ | |
| 17793 @deprecated // Use "this.superKeyword" | |
| 17794 Token get keyword => superKeyword; | |
| 17795 | |
| 17796 /** | |
| 17797 * Set the token for the 'super' keyword to the given [token]. | |
| 17798 */ | |
| 17799 @deprecated // Use "this.superKeyword" | |
| 17800 set keyword(Token token) { | |
| 17801 superKeyword = token; | |
| 17802 } | |
| 17803 | |
| 17804 @override | 17230 @override |
| 17805 accept(AstVisitor visitor) => visitor.visitSuperConstructorInvocation(this); | 17231 accept(AstVisitor visitor) => visitor.visitSuperConstructorInvocation(this); |
| 17806 | 17232 |
| 17807 @override | 17233 @override |
| 17808 void visitChildren(AstVisitor visitor) { | 17234 void visitChildren(AstVisitor visitor) { |
| 17809 _safelyVisitChild(_constructorName, visitor); | 17235 _safelyVisitChild(_constructorName, visitor); |
| 17810 _safelyVisitChild(_argumentList, visitor); | 17236 _safelyVisitChild(_argumentList, visitor); |
| 17811 } | 17237 } |
| 17812 } | 17238 } |
| 17813 | 17239 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 17830 | 17256 |
| 17831 @override | 17257 @override |
| 17832 Token get beginToken => superKeyword; | 17258 Token get beginToken => superKeyword; |
| 17833 | 17259 |
| 17834 @override | 17260 @override |
| 17835 Iterable get childEntities => new ChildEntities()..add(superKeyword); | 17261 Iterable get childEntities => new ChildEntities()..add(superKeyword); |
| 17836 | 17262 |
| 17837 @override | 17263 @override |
| 17838 Token get endToken => superKeyword; | 17264 Token get endToken => superKeyword; |
| 17839 | 17265 |
| 17840 /** | |
| 17841 * Return the token for the 'super' keyword. | |
| 17842 */ | |
| 17843 @deprecated // Use "this.superKeyword" | |
| 17844 Token get keyword => superKeyword; | |
| 17845 | |
| 17846 /** | |
| 17847 * Set the token for the 'super' keyword to the given [token]. | |
| 17848 */ | |
| 17849 @deprecated // Use "this.superKeyword" | |
| 17850 set keyword(Token token) { | |
| 17851 superKeyword = token; | |
| 17852 } | |
| 17853 | |
| 17854 @override | 17266 @override |
| 17855 int get precedence => 16; | 17267 int get precedence => 16; |
| 17856 | 17268 |
| 17857 @override | 17269 @override |
| 17858 accept(AstVisitor visitor) => visitor.visitSuperExpression(this); | 17270 accept(AstVisitor visitor) => visitor.visitSuperExpression(this); |
| 17859 | 17271 |
| 17860 @override | 17272 @override |
| 17861 void visitChildren(AstVisitor visitor) { | 17273 void visitChildren(AstVisitor visitor) { |
| 17862 // There are no children to visit. | 17274 // There are no children to visit. |
| 17863 } | 17275 } |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18098 | 17510 |
| 18099 /** | 17511 /** |
| 18100 * Set the expression used to determine which of the switch members will be | 17512 * Set the expression used to determine which of the switch members will be |
| 18101 * selected to the given [expression]. | 17513 * selected to the given [expression]. |
| 18102 */ | 17514 */ |
| 18103 void set expression(Expression expression) { | 17515 void set expression(Expression expression) { |
| 18104 _expression = _becomeParentOf(expression); | 17516 _expression = _becomeParentOf(expression); |
| 18105 } | 17517 } |
| 18106 | 17518 |
| 18107 /** | 17519 /** |
| 18108 * Return the token representing the 'switch' keyword. | |
| 18109 */ | |
| 18110 @deprecated // Use "this.switchKeyword" | |
| 18111 Token get keyword => switchKeyword; | |
| 18112 | |
| 18113 /** | |
| 18114 * Set the token representing the 'switch' keyword to the given [token]. | |
| 18115 */ | |
| 18116 @deprecated // Use "this.switchKeyword" | |
| 18117 set keyword(Token token) { | |
| 18118 switchKeyword = token; | |
| 18119 } | |
| 18120 | |
| 18121 /** | |
| 18122 * Return the switch members that can be selected by the expression. | 17520 * Return the switch members that can be selected by the expression. |
| 18123 */ | 17521 */ |
| 18124 NodeList<SwitchMember> get members => _members; | 17522 NodeList<SwitchMember> get members => _members; |
| 18125 | 17523 |
| 18126 @override | 17524 @override |
| 18127 accept(AstVisitor visitor) => visitor.visitSwitchStatement(this); | 17525 accept(AstVisitor visitor) => visitor.visitSwitchStatement(this); |
| 18128 | 17526 |
| 18129 @override | 17527 @override |
| 18130 void visitChildren(AstVisitor visitor) { | 17528 void visitChildren(AstVisitor visitor) { |
| 18131 _safelyVisitChild(_expression, visitor); | 17529 _safelyVisitChild(_expression, visitor); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18195 | 17593 |
| 18196 @override | 17594 @override |
| 18197 Token get beginToken => thisKeyword; | 17595 Token get beginToken => thisKeyword; |
| 18198 | 17596 |
| 18199 @override | 17597 @override |
| 18200 Iterable get childEntities => new ChildEntities()..add(thisKeyword); | 17598 Iterable get childEntities => new ChildEntities()..add(thisKeyword); |
| 18201 | 17599 |
| 18202 @override | 17600 @override |
| 18203 Token get endToken => thisKeyword; | 17601 Token get endToken => thisKeyword; |
| 18204 | 17602 |
| 18205 /** | |
| 18206 * Return the token representing the 'this' keyword. | |
| 18207 */ | |
| 18208 @deprecated // Use "this.thisKeyword" | |
| 18209 Token get keyword => thisKeyword; | |
| 18210 | |
| 18211 /** | |
| 18212 * Set the token representing the 'this' keyword to the given [token]. | |
| 18213 */ | |
| 18214 @deprecated // Use "this.thisKeyword" | |
| 18215 set keyword(Token token) { | |
| 18216 thisKeyword = token; | |
| 18217 } | |
| 18218 | |
| 18219 @override | 17603 @override |
| 18220 int get precedence => 16; | 17604 int get precedence => 16; |
| 18221 | 17605 |
| 18222 @override | 17606 @override |
| 18223 accept(AstVisitor visitor) => visitor.visitThisExpression(this); | 17607 accept(AstVisitor visitor) => visitor.visitThisExpression(this); |
| 18224 | 17608 |
| 18225 @override | 17609 @override |
| 18226 void visitChildren(AstVisitor visitor) { | 17610 void visitChildren(AstVisitor visitor) { |
| 18227 // There are no children to visit. | 17611 // There are no children to visit. |
| 18228 } | 17612 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18273 Expression get expression => _expression; | 17657 Expression get expression => _expression; |
| 18274 | 17658 |
| 18275 /** | 17659 /** |
| 18276 * Set the expression computing the exception to be thrown to the given | 17660 * Set the expression computing the exception to be thrown to the given |
| 18277 * [expression]. | 17661 * [expression]. |
| 18278 */ | 17662 */ |
| 18279 void set expression(Expression expression) { | 17663 void set expression(Expression expression) { |
| 18280 _expression = _becomeParentOf(expression); | 17664 _expression = _becomeParentOf(expression); |
| 18281 } | 17665 } |
| 18282 | 17666 |
| 18283 /** | |
| 18284 * Return the token representing the 'throw' keyword. | |
| 18285 */ | |
| 18286 @deprecated // Use "this.throwKeyword" | |
| 18287 Token get keyword => throwKeyword; | |
| 18288 | |
| 18289 /** | |
| 18290 * Set the token representing the 'throw' keyword to the given [token]. | |
| 18291 */ | |
| 18292 @deprecated // Use "this.throwKeyword" | |
| 18293 set keyword(Token token) { | |
| 18294 throwKeyword = token; | |
| 18295 } | |
| 18296 | |
| 18297 @override | 17667 @override |
| 18298 int get precedence => 0; | 17668 int get precedence => 0; |
| 18299 | 17669 |
| 18300 @override | 17670 @override |
| 18301 accept(AstVisitor visitor) => visitor.visitThrowExpression(this); | 17671 accept(AstVisitor visitor) => visitor.visitThrowExpression(this); |
| 18302 | 17672 |
| 18303 @override | 17673 @override |
| 18304 void visitChildren(AstVisitor visitor) { | 17674 void visitChildren(AstVisitor visitor) { |
| 18305 _safelyVisitChild(_expression, visitor); | 17675 _safelyVisitChild(_expression, visitor); |
| 18306 } | 17676 } |
| (...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19655 */ | 19025 */ |
| 19656 TypeAlias(Comment comment, List<Annotation> metadata, this.typedefKeyword, | 19026 TypeAlias(Comment comment, List<Annotation> metadata, this.typedefKeyword, |
| 19657 SimpleIdentifier name, this.semicolon) | 19027 SimpleIdentifier name, this.semicolon) |
| 19658 : super(comment, metadata, name); | 19028 : super(comment, metadata, name); |
| 19659 | 19029 |
| 19660 @override | 19030 @override |
| 19661 Token get endToken => semicolon; | 19031 Token get endToken => semicolon; |
| 19662 | 19032 |
| 19663 @override | 19033 @override |
| 19664 Token get firstTokenAfterCommentAndMetadata => typedefKeyword; | 19034 Token get firstTokenAfterCommentAndMetadata => typedefKeyword; |
| 19665 | |
| 19666 /** | |
| 19667 * Return the token representing the 'typedef' keyword. | |
| 19668 */ | |
| 19669 @deprecated // Use "this.typedefKeyword" | |
| 19670 Token get keyword => typedefKeyword; | |
| 19671 | |
| 19672 /** | |
| 19673 * Set the token representing the 'typedef' keyword to the given [token]. | |
| 19674 */ | |
| 19675 @deprecated // Use "this.typedefKeyword" | |
| 19676 set keyword(Token token) { | |
| 19677 typedefKeyword = token; | |
| 19678 } | |
| 19679 } | 19035 } |
| 19680 | 19036 |
| 19681 /** | 19037 /** |
| 19682 * A list of type arguments. | 19038 * A list of type arguments. |
| 19683 * | 19039 * |
| 19684 * > typeArguments ::= | 19040 * > typeArguments ::= |
| 19685 * > '<' typeName (',' typeName)* '>' | 19041 * > '<' typeName (',' typeName)* '>' |
| 19686 */ | 19042 */ |
| 19687 class TypeArgumentList extends AstNode { | 19043 class TypeArgumentList extends AstNode { |
| 19688 /** | 19044 /** |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19951 if (_bound == null) { | 19307 if (_bound == null) { |
| 19952 return _name.endToken; | 19308 return _name.endToken; |
| 19953 } | 19309 } |
| 19954 return _bound.endToken; | 19310 return _bound.endToken; |
| 19955 } | 19311 } |
| 19956 | 19312 |
| 19957 @override | 19313 @override |
| 19958 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; | 19314 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; |
| 19959 | 19315 |
| 19960 /** | 19316 /** |
| 19961 * Return the token representing the 'extends' keyword, or `null` if there is | |
| 19962 * no explicit upper bound. | |
| 19963 */ | |
| 19964 @deprecated // Use "this.extendsKeyword" | |
| 19965 Token get keyword => extendsKeyword; | |
| 19966 | |
| 19967 /** | |
| 19968 * Set the token representing the 'extends' keyword to the given [token]. | |
| 19969 */ | |
| 19970 @deprecated // Use "this.extendsKeyword" | |
| 19971 set keyword(Token token) { | |
| 19972 extendsKeyword = token; | |
| 19973 } | |
| 19974 | |
| 19975 /** | |
| 19976 * Return the name of the type parameter. | 19317 * Return the name of the type parameter. |
| 19977 */ | 19318 */ |
| 19978 SimpleIdentifier get name => _name; | 19319 SimpleIdentifier get name => _name; |
| 19979 | 19320 |
| 19980 /** | 19321 /** |
| 19981 * Set the name of the type parameter to the given [identifier]. | 19322 * Set the name of the type parameter to the given [identifier]. |
| 19982 */ | 19323 */ |
| 19983 void set name(SimpleIdentifier identifier) { | 19324 void set name(SimpleIdentifier identifier) { |
| 19984 _name = _becomeParentOf(identifier); | 19325 _name = _becomeParentOf(identifier); |
| 19985 } | 19326 } |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20897 * Set the expression used to determine whether to execute the body of the | 20238 * Set the expression used to determine whether to execute the body of the |
| 20898 * loop to the given [expression]. | 20239 * loop to the given [expression]. |
| 20899 */ | 20240 */ |
| 20900 void set condition(Expression expression) { | 20241 void set condition(Expression expression) { |
| 20901 _condition = _becomeParentOf(expression); | 20242 _condition = _becomeParentOf(expression); |
| 20902 } | 20243 } |
| 20903 | 20244 |
| 20904 @override | 20245 @override |
| 20905 Token get endToken => _body.endToken; | 20246 Token get endToken => _body.endToken; |
| 20906 | 20247 |
| 20907 /** | |
| 20908 * Return the token representing the 'while' keyword. | |
| 20909 */ | |
| 20910 @deprecated // Use "this.whileKeyword" | |
| 20911 Token get keyword => whileKeyword; | |
| 20912 | |
| 20913 /** | |
| 20914 * Set the token representing the 'while' keyword to the given [token]. | |
| 20915 */ | |
| 20916 @deprecated // Use "this.whileKeyword" | |
| 20917 set keyword(Token token) { | |
| 20918 whileKeyword = token; | |
| 20919 } | |
| 20920 | |
| 20921 @override | 20248 @override |
| 20922 accept(AstVisitor visitor) => visitor.visitWhileStatement(this); | 20249 accept(AstVisitor visitor) => visitor.visitWhileStatement(this); |
| 20923 | 20250 |
| 20924 @override | 20251 @override |
| 20925 void visitChildren(AstVisitor visitor) { | 20252 void visitChildren(AstVisitor visitor) { |
| 20926 _safelyVisitChild(_condition, visitor); | 20253 _safelyVisitChild(_condition, visitor); |
| 20927 _safelyVisitChild(_body, visitor); | 20254 _safelyVisitChild(_body, visitor); |
| 20928 } | 20255 } |
| 20929 } | 20256 } |
| 20930 | 20257 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 20958 @override | 20285 @override |
| 20959 // TODO(paulberry): add commas. | 20286 // TODO(paulberry): add commas. |
| 20960 Iterable get childEntities => new ChildEntities() | 20287 Iterable get childEntities => new ChildEntities() |
| 20961 ..add(withKeyword) | 20288 ..add(withKeyword) |
| 20962 ..addAll(_mixinTypes); | 20289 ..addAll(_mixinTypes); |
| 20963 | 20290 |
| 20964 @override | 20291 @override |
| 20965 Token get endToken => _mixinTypes.endToken; | 20292 Token get endToken => _mixinTypes.endToken; |
| 20966 | 20293 |
| 20967 /** | 20294 /** |
| 20968 * Set the token representing the 'with' keyword to the given [token]. | |
| 20969 */ | |
| 20970 @deprecated // Use "this.withKeyword" | |
| 20971 void set mixinKeyword(Token token) { | |
| 20972 this.withKeyword = token; | |
| 20973 } | |
| 20974 | |
| 20975 /** | |
| 20976 * Return the names of the mixins that were specified. | 20295 * Return the names of the mixins that were specified. |
| 20977 */ | 20296 */ |
| 20978 NodeList<TypeName> get mixinTypes => _mixinTypes; | 20297 NodeList<TypeName> get mixinTypes => _mixinTypes; |
| 20979 | 20298 |
| 20980 @override | 20299 @override |
| 20981 accept(AstVisitor visitor) => visitor.visitWithClause(this); | 20300 accept(AstVisitor visitor) => visitor.visitWithClause(this); |
| 20982 | 20301 |
| 20983 @override | 20302 @override |
| 20984 void visitChildren(AstVisitor visitor) { | 20303 void visitChildren(AstVisitor visitor) { |
| 20985 _mixinTypes.accept(visitor); | 20304 _mixinTypes.accept(visitor); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21058 } | 20377 } |
| 21059 | 20378 |
| 21060 @override | 20379 @override |
| 21061 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); | 20380 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); |
| 21062 | 20381 |
| 21063 @override | 20382 @override |
| 21064 void visitChildren(AstVisitor visitor) { | 20383 void visitChildren(AstVisitor visitor) { |
| 21065 _safelyVisitChild(_expression, visitor); | 20384 _safelyVisitChild(_expression, visitor); |
| 21066 } | 20385 } |
| 21067 } | 20386 } |
| OLD | NEW |