| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.ast; | 8 library engine.ast; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 _arguments.accept(visitor); | 523 _arguments.accept(visitor); |
| 524 } | 524 } |
| 525 | 525 |
| 526 /** | 526 /** |
| 527 * If the given expression is a child of this list, and the AST structure has
been resolved, and | 527 * If the given expression is a child of this list, and the AST structure has
been resolved, and |
| 528 * the function being invoked is known based on propagated type information, a
nd the expression | 528 * the function being invoked is known based on propagated type information, a
nd the expression |
| 529 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter | 529 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter |
| 530 * element representing the parameter to which the value of the given expressi
on will be bound. | 530 * element representing the parameter to which the value of the given expressi
on will be bound. |
| 531 * Otherwise, return `null`. | 531 * Otherwise, return `null`. |
| 532 * | 532 * |
| 533 * This method is only intended to be used by [Expression#getPropagatedParamet
erElement]. | 533 * This method is only intended to be used by [Expression.propagatedParameterE
lement]. |
| 534 * | 534 * |
| 535 * @param expression the expression corresponding to the parameter to be retur
ned | 535 * @param expression the expression corresponding to the parameter to be retur
ned |
| 536 * @return the parameter element representing the parameter to which the value
of the expression | 536 * @return the parameter element representing the parameter to which the value
of the expression |
| 537 * will be bound | 537 * will be bound |
| 538 */ | 538 */ |
| 539 ParameterElement getPropagatedParameterElementFor(Expression expression) { | 539 ParameterElement getPropagatedParameterElementFor(Expression expression) { |
| 540 if (_correspondingPropagatedParameters == null) { | 540 if (_correspondingPropagatedParameters == null) { |
| 541 // Either the AST structure has not been resolved or the invocation of whi
ch this list is a | 541 // Either the AST structure has not been resolved or the invocation of whi
ch this list is a |
| 542 // part could not be resolved. | 542 // part could not be resolved. |
| 543 return null; | 543 return null; |
| 544 } | 544 } |
| 545 int index = _arguments.indexOf(expression); | 545 int index = _arguments.indexOf(expression); |
| 546 if (index < 0) { | 546 if (index < 0) { |
| 547 // The expression isn't a child of this node. | 547 // The expression isn't a child of this node. |
| 548 return null; | 548 return null; |
| 549 } | 549 } |
| 550 return _correspondingPropagatedParameters[index]; | 550 return _correspondingPropagatedParameters[index]; |
| 551 } | 551 } |
| 552 | 552 |
| 553 /** | 553 /** |
| 554 * If the given expression is a child of this list, and the AST structure has
been resolved, and | 554 * If the given expression is a child of this list, and the AST structure has
been resolved, and |
| 555 * the function being invoked is known based on static type information, and t
he expression | 555 * the function being invoked is known based on static type information, and t
he expression |
| 556 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter | 556 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter |
| 557 * element representing the parameter to which the value of the given expressi
on will be bound. | 557 * element representing the parameter to which the value of the given expressi
on will be bound. |
| 558 * Otherwise, return `null`. | 558 * Otherwise, return `null`. |
| 559 * | 559 * |
| 560 * This method is only intended to be used by [Expression#getStaticParameterEl
ement]. | 560 * This method is only intended to be used by [Expression.staticParameterEleme
nt]. |
| 561 * | 561 * |
| 562 * @param expression the expression corresponding to the parameter to be retur
ned | 562 * @param expression the expression corresponding to the parameter to be retur
ned |
| 563 * @return the parameter element representing the parameter to which the value
of the expression | 563 * @return the parameter element representing the parameter to which the value
of the expression |
| 564 * will be bound | 564 * will be bound |
| 565 */ | 565 */ |
| 566 ParameterElement getStaticParameterElementFor(Expression expression) { | 566 ParameterElement getStaticParameterElementFor(Expression expression) { |
| 567 if (_correspondingStaticParameters == null) { | 567 if (_correspondingStaticParameters == null) { |
| 568 // Either the AST structure has not been resolved or the invocation of whi
ch this list is a | 568 // Either the AST structure has not been resolved or the invocation of whi
ch this list is a |
| 569 // part could not be resolved. | 569 // part could not be resolved. |
| 570 return null; | 570 return null; |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 void visitChildren(AstVisitor visitor) { | 913 void visitChildren(AstVisitor visitor) { |
| 914 safelyVisitChild(_leftHandSide, visitor); | 914 safelyVisitChild(_leftHandSide, visitor); |
| 915 safelyVisitChild(_rightHandSide, visitor); | 915 safelyVisitChild(_rightHandSide, visitor); |
| 916 } | 916 } |
| 917 | 917 |
| 918 /** | 918 /** |
| 919 * If the AST structure has been resolved, and the function being invoked is k
nown based on | 919 * If the AST structure has been resolved, and the function being invoked is k
nown based on |
| 920 * propagated type information, then return the parameter element representing
the parameter to | 920 * propagated type information, then return the parameter element representing
the parameter to |
| 921 * which the value of the right operand will be bound. Otherwise, return `null
`. | 921 * which the value of the right operand will be bound. Otherwise, return `null
`. |
| 922 * | 922 * |
| 923 * This method is only intended to be used by [Expression#getPropagatedParamet
erElement]. | 923 * This method is only intended to be used by [Expression.propagatedParameterE
lement]. |
| 924 * | 924 * |
| 925 * @return the parameter element representing the parameter to which the value
of the right | 925 * @return the parameter element representing the parameter to which the value
of the right |
| 926 * operand will be bound | 926 * operand will be bound |
| 927 */ | 927 */ |
| 928 ParameterElement get propagatedParameterElementForRightHandSide { | 928 ParameterElement get propagatedParameterElementForRightHandSide { |
| 929 ExecutableElement executableElement = null; | 929 ExecutableElement executableElement = null; |
| 930 if (_propagatedElement != null) { | 930 if (_propagatedElement != null) { |
| 931 executableElement = _propagatedElement; | 931 executableElement = _propagatedElement; |
| 932 } else { | 932 } else { |
| 933 if (_leftHandSide is Identifier) { | 933 if (_leftHandSide is Identifier) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 953 return null; | 953 return null; |
| 954 } | 954 } |
| 955 return parameters[0]; | 955 return parameters[0]; |
| 956 } | 956 } |
| 957 | 957 |
| 958 /** | 958 /** |
| 959 * If the AST structure has been resolved, and the function being invoked is k
nown based on static | 959 * If the AST structure has been resolved, and the function being invoked is k
nown based on static |
| 960 * type information, then return the parameter element representing the parame
ter to which the | 960 * type information, then return the parameter element representing the parame
ter to which the |
| 961 * value of the right operand will be bound. Otherwise, return `null`. | 961 * value of the right operand will be bound. Otherwise, return `null`. |
| 962 * | 962 * |
| 963 * This method is only intended to be used by [Expression#getStaticParameterEl
ement]. | 963 * This method is only intended to be used by [Expression.staticParameterEleme
nt]. |
| 964 * | 964 * |
| 965 * @return the parameter element representing the parameter to which the value
of the right | 965 * @return the parameter element representing the parameter to which the value
of the right |
| 966 * operand will be bound | 966 * operand will be bound |
| 967 */ | 967 */ |
| 968 ParameterElement get staticParameterElementForRightHandSide { | 968 ParameterElement get staticParameterElementForRightHandSide { |
| 969 ExecutableElement executableElement = null; | 969 ExecutableElement executableElement = null; |
| 970 if (_staticElement != null) { | 970 if (_staticElement != null) { |
| 971 executableElement = _staticElement; | 971 executableElement = _staticElement; |
| 972 } else { | 972 } else { |
| 973 if (_leftHandSide is Identifier) { | 973 if (_leftHandSide is Identifier) { |
| (...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3323 void visitChildren(AstVisitor visitor) { | 3323 void visitChildren(AstVisitor visitor) { |
| 3324 safelyVisitChild(_leftOperand, visitor); | 3324 safelyVisitChild(_leftOperand, visitor); |
| 3325 safelyVisitChild(_rightOperand, visitor); | 3325 safelyVisitChild(_rightOperand, visitor); |
| 3326 } | 3326 } |
| 3327 | 3327 |
| 3328 /** | 3328 /** |
| 3329 * If the AST structure has been resolved, and the function being invoked is k
nown based on | 3329 * If the AST structure has been resolved, and the function being invoked is k
nown based on |
| 3330 * propagated type information, then return the parameter element representing
the parameter to | 3330 * propagated type information, then return the parameter element representing
the parameter to |
| 3331 * which the value of the right operand will be bound. Otherwise, return `null
`. | 3331 * which the value of the right operand will be bound. Otherwise, return `null
`. |
| 3332 * | 3332 * |
| 3333 * This method is only intended to be used by [Expression#getPropagatedParamet
erElement]. | 3333 * This method is only intended to be used by [Expression.propagatedParameterE
lement]. |
| 3334 * | 3334 * |
| 3335 * @return the parameter element representing the parameter to which the value
of the right | 3335 * @return the parameter element representing the parameter to which the value
of the right |
| 3336 * operand will be bound | 3336 * operand will be bound |
| 3337 */ | 3337 */ |
| 3338 ParameterElement get propagatedParameterElementForRightOperand { | 3338 ParameterElement get propagatedParameterElementForRightOperand { |
| 3339 if (_propagatedElement == null) { | 3339 if (_propagatedElement == null) { |
| 3340 return null; | 3340 return null; |
| 3341 } | 3341 } |
| 3342 List<ParameterElement> parameters = _propagatedElement.parameters; | 3342 List<ParameterElement> parameters = _propagatedElement.parameters; |
| 3343 if (parameters.length < 1) { | 3343 if (parameters.length < 1) { |
| 3344 return null; | 3344 return null; |
| 3345 } | 3345 } |
| 3346 return parameters[0]; | 3346 return parameters[0]; |
| 3347 } | 3347 } |
| 3348 | 3348 |
| 3349 /** | 3349 /** |
| 3350 * If the AST structure has been resolved, and the function being invoked is k
nown based on static | 3350 * If the AST structure has been resolved, and the function being invoked is k
nown based on static |
| 3351 * type information, then return the parameter element representing the parame
ter to which the | 3351 * type information, then return the parameter element representing the parame
ter to which the |
| 3352 * value of the right operand will be bound. Otherwise, return `null`. | 3352 * value of the right operand will be bound. Otherwise, return `null`. |
| 3353 * | 3353 * |
| 3354 * This method is only intended to be used by [Expression#getStaticParameterEl
ement]. | 3354 * This method is only intended to be used by [Expression.staticParameterEleme
nt]. |
| 3355 * | 3355 * |
| 3356 * @return the parameter element representing the parameter to which the value
of the right | 3356 * @return the parameter element representing the parameter to which the value
of the right |
| 3357 * operand will be bound | 3357 * operand will be bound |
| 3358 */ | 3358 */ |
| 3359 ParameterElement get staticParameterElementForRightOperand { | 3359 ParameterElement get staticParameterElementForRightOperand { |
| 3360 if (_staticElement == null) { | 3360 if (_staticElement == null) { |
| 3361 return null; | 3361 return null; |
| 3362 } | 3362 } |
| 3363 List<ParameterElement> parameters = _staticElement.parameters; | 3363 List<ParameterElement> parameters = _staticElement.parameters; |
| 3364 if (parameters.length < 1) { | 3364 if (parameters.length < 1) { |
| (...skipping 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6191 void visitChildren(AstVisitor visitor) { | 6191 void visitChildren(AstVisitor visitor) { |
| 6192 safelyVisitChild(_parameter, visitor); | 6192 safelyVisitChild(_parameter, visitor); |
| 6193 safelyVisitChild(_defaultValue, visitor); | 6193 safelyVisitChild(_defaultValue, visitor); |
| 6194 } | 6194 } |
| 6195 } | 6195 } |
| 6196 | 6196 |
| 6197 /** | 6197 /** |
| 6198 * This recursive Ast visitor is used to run over [Expression]s to determine if
the expression | 6198 * This recursive Ast visitor is used to run over [Expression]s to determine if
the expression |
| 6199 * is composed by at least one deferred [PrefixedIdentifier]. | 6199 * is composed by at least one deferred [PrefixedIdentifier]. |
| 6200 * | 6200 * |
| 6201 * @see PrefixedIdentifier#isDeferred() | 6201 * See [PrefixedIdentifier.isDeferred]. |
| 6202 */ | 6202 */ |
| 6203 class DeferredLibraryReferenceDetector extends RecursiveAstVisitor<Object> { | 6203 class DeferredLibraryReferenceDetector extends RecursiveAstVisitor<Object> { |
| 6204 bool _result = false; | 6204 bool _result = false; |
| 6205 | 6205 |
| 6206 /** | 6206 /** |
| 6207 * Return the result, `true` if the visitor found a [PrefixedIdentifier] that
returned | 6207 * Return `true` if the visitor found a [PrefixedIdentifier] that returned |
| 6208 * `true` to the [PrefixedIdentifier#isDeferred] query. | 6208 * `true` to the [PrefixedIdentifier.isDeferred] query. |
| 6209 * | |
| 6210 * @return `true` if the visitor found a [PrefixedIdentifier] that returned | |
| 6211 * `true` to the [PrefixedIdentifier#isDeferred] query | |
| 6212 */ | 6209 */ |
| 6213 bool get result => _result; | 6210 bool get result => _result; |
| 6214 | 6211 |
| 6215 @override | 6212 @override |
| 6216 Object visitPrefixedIdentifier(PrefixedIdentifier node) { | 6213 Object visitPrefixedIdentifier(PrefixedIdentifier node) { |
| 6217 // If result is already true, skip. | 6214 // If result is already true, skip. |
| 6218 if (!_result) { | 6215 if (!_result) { |
| 6219 // Set result to true if isDeferred() is true | 6216 // Set result to true if isDeferred() is true |
| 6220 if (node.isDeferred) { | 6217 if (node.isDeferred) { |
| 6221 _result = true; | 6218 _result = true; |
| (...skipping 4214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10436 */ | 10433 */ |
| 10437 MethodElement get propagatedElement => _propagatedElement; | 10434 MethodElement get propagatedElement => _propagatedElement; |
| 10438 | 10435 |
| 10439 /** | 10436 /** |
| 10440 * Return the expression used to compute the object being indexed. If this ind
ex expression is not | 10437 * Return the expression used to compute the object being indexed. If this ind
ex expression is not |
| 10441 * part of a cascade expression, then this is the same as [getTarget]. If this
index | 10438 * part of a cascade expression, then this is the same as [getTarget]. If this
index |
| 10442 * expression is part of a cascade expression, then the target expression stor
ed with the cascade | 10439 * expression is part of a cascade expression, then the target expression stor
ed with the cascade |
| 10443 * expression is returned. | 10440 * expression is returned. |
| 10444 * | 10441 * |
| 10445 * @return the expression used to compute the object being indexed | 10442 * @return the expression used to compute the object being indexed |
| 10446 * @see #getTarget() | 10443 * See [target]. |
| 10447 */ | 10444 */ |
| 10448 Expression get realTarget { | 10445 Expression get realTarget { |
| 10449 if (isCascaded) { | 10446 if (isCascaded) { |
| 10450 AstNode ancestor = parent; | 10447 AstNode ancestor = parent; |
| 10451 while (ancestor is! CascadeExpression) { | 10448 while (ancestor is! CascadeExpression) { |
| 10452 if (ancestor == null) { | 10449 if (ancestor == null) { |
| 10453 return _target; | 10450 return _target; |
| 10454 } | 10451 } |
| 10455 ancestor = ancestor.parent; | 10452 ancestor = ancestor.parent; |
| 10456 } | 10453 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 10474 * | 10471 * |
| 10475 * @return the element associated with the operator | 10472 * @return the element associated with the operator |
| 10476 */ | 10473 */ |
| 10477 MethodElement get staticElement => _staticElement; | 10474 MethodElement get staticElement => _staticElement; |
| 10478 | 10475 |
| 10479 /** | 10476 /** |
| 10480 * Return the expression used to compute the object being indexed, or `null` i
f this index | 10477 * Return the expression used to compute the object being indexed, or `null` i
f this index |
| 10481 * expression is part of a cascade expression. | 10478 * expression is part of a cascade expression. |
| 10482 * | 10479 * |
| 10483 * @return the expression used to compute the object being indexed | 10480 * @return the expression used to compute the object being indexed |
| 10484 * @see #getRealTarget() | 10481 * See [realTarget]. |
| 10485 */ | 10482 */ |
| 10486 Expression get target => _target; | 10483 Expression get target => _target; |
| 10487 | 10484 |
| 10488 /** | 10485 /** |
| 10489 * Return `true` if this expression is computing a right-hand value. | 10486 * Return `true` if this expression is computing a right-hand value. |
| 10490 * | 10487 * |
| 10491 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar
e | 10488 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar
e |
| 10492 * they mutually exclusive. In other words, it is possible for both methods to
return `true` | 10489 * they mutually exclusive. In other words, it is possible for both methods to
return `true` |
| 10493 * when invoked on the same node. | 10490 * when invoked on the same node. |
| 10494 * | 10491 * |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10599 void visitChildren(AstVisitor visitor) { | 10596 void visitChildren(AstVisitor visitor) { |
| 10600 safelyVisitChild(_target, visitor); | 10597 safelyVisitChild(_target, visitor); |
| 10601 safelyVisitChild(_index, visitor); | 10598 safelyVisitChild(_index, visitor); |
| 10602 } | 10599 } |
| 10603 | 10600 |
| 10604 /** | 10601 /** |
| 10605 * If the AST structure has been resolved, and the function being invoked is k
nown based on | 10602 * If the AST structure has been resolved, and the function being invoked is k
nown based on |
| 10606 * propagated type information, then return the parameter element representing
the parameter to | 10603 * propagated type information, then return the parameter element representing
the parameter to |
| 10607 * which the value of the index expression will be bound. Otherwise, return `n
ull`. | 10604 * which the value of the index expression will be bound. Otherwise, return `n
ull`. |
| 10608 * | 10605 * |
| 10609 * This method is only intended to be used by [Expression#getPropagatedParamet
erElement]. | 10606 * This method is only intended to be used by [Expression.propagatedParameterE
lement]. |
| 10610 * | 10607 * |
| 10611 * @return the parameter element representing the parameter to which the value
of the index | 10608 * @return the parameter element representing the parameter to which the value
of the index |
| 10612 * expression will be bound | 10609 * expression will be bound |
| 10613 */ | 10610 */ |
| 10614 ParameterElement get propagatedParameterElementForIndex { | 10611 ParameterElement get propagatedParameterElementForIndex { |
| 10615 if (_propagatedElement == null) { | 10612 if (_propagatedElement == null) { |
| 10616 return null; | 10613 return null; |
| 10617 } | 10614 } |
| 10618 List<ParameterElement> parameters = _propagatedElement.parameters; | 10615 List<ParameterElement> parameters = _propagatedElement.parameters; |
| 10619 if (parameters.length < 1) { | 10616 if (parameters.length < 1) { |
| 10620 return null; | 10617 return null; |
| 10621 } | 10618 } |
| 10622 return parameters[0]; | 10619 return parameters[0]; |
| 10623 } | 10620 } |
| 10624 | 10621 |
| 10625 /** | 10622 /** |
| 10626 * If the AST structure has been resolved, and the function being invoked is k
nown based on static | 10623 * If the AST structure has been resolved, and the function being invoked is k
nown based on static |
| 10627 * type information, then return the parameter element representing the parame
ter to which the | 10624 * type information, then return the parameter element representing the parame
ter to which the |
| 10628 * value of the index expression will be bound. Otherwise, return `null`. | 10625 * value of the index expression will be bound. Otherwise, return `null`. |
| 10629 * | 10626 * |
| 10630 * This method is only intended to be used by [Expression#getStaticParameterEl
ement]. | 10627 * This method is only intended to be used by [Expression.staticParameterEleme
nt]. |
| 10631 * | 10628 * |
| 10632 * @return the parameter element representing the parameter to which the value
of the index | 10629 * @return the parameter element representing the parameter to which the value
of the index |
| 10633 * expression will be bound | 10630 * expression will be bound |
| 10634 */ | 10631 */ |
| 10635 ParameterElement get staticParameterElementForIndex { | 10632 ParameterElement get staticParameterElementForIndex { |
| 10636 if (_staticElement == null) { | 10633 if (_staticElement == null) { |
| 10637 return null; | 10634 return null; |
| 10638 } | 10635 } |
| 10639 List<ParameterElement> parameters = _staticElement.parameters; | 10636 List<ParameterElement> parameters = _staticElement.parameters; |
| 10640 if (parameters.length < 1) { | 10637 if (parameters.length < 1) { |
| (...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12016 @override | 12013 @override |
| 12017 int get precedence => 15; | 12014 int get precedence => 15; |
| 12018 | 12015 |
| 12019 /** | 12016 /** |
| 12020 * Return the expression used to compute the receiver of the invocation. If th
is invocation is not | 12017 * Return the expression used to compute the receiver of the invocation. If th
is invocation is not |
| 12021 * part of a cascade expression, then this is the same as [getTarget]. If this
invocation | 12018 * part of a cascade expression, then this is the same as [getTarget]. If this
invocation |
| 12022 * is part of a cascade expression, then the target stored with the cascade ex
pression is | 12019 * is part of a cascade expression, then the target stored with the cascade ex
pression is |
| 12023 * returned. | 12020 * returned. |
| 12024 * | 12021 * |
| 12025 * @return the expression used to compute the receiver of the invocation | 12022 * @return the expression used to compute the receiver of the invocation |
| 12026 * @see #getTarget() | 12023 * See [target]. |
| 12027 */ | 12024 */ |
| 12028 Expression get realTarget { | 12025 Expression get realTarget { |
| 12029 if (isCascaded) { | 12026 if (isCascaded) { |
| 12030 AstNode ancestor = parent; | 12027 AstNode ancestor = parent; |
| 12031 while (ancestor is! CascadeExpression) { | 12028 while (ancestor is! CascadeExpression) { |
| 12032 if (ancestor == null) { | 12029 if (ancestor == null) { |
| 12033 return _target; | 12030 return _target; |
| 12034 } | 12031 } |
| 12035 ancestor = ancestor.parent; | 12032 ancestor = ancestor.parent; |
| 12036 } | 12033 } |
| 12037 return (ancestor as CascadeExpression).target; | 12034 return (ancestor as CascadeExpression).target; |
| 12038 } | 12035 } |
| 12039 return _target; | 12036 return _target; |
| 12040 } | 12037 } |
| 12041 | 12038 |
| 12042 /** | 12039 /** |
| 12043 * Return the expression producing the object on which the method is defined,
or `null` if | 12040 * Return the expression producing the object on which the method is defined,
or `null` if |
| 12044 * there is no target (that is, the target is implicitly `this`) or if this me
thod | 12041 * there is no target (that is, the target is implicitly `this`) or if this me
thod |
| 12045 * invocation is part of a cascade expression. | 12042 * invocation is part of a cascade expression. |
| 12046 * | 12043 * |
| 12047 * @return the expression producing the object on which the method is defined | 12044 * @return the expression producing the object on which the method is defined |
| 12048 * @see #getRealTarget() | 12045 * See [realTarget]. |
| 12049 */ | 12046 */ |
| 12050 Expression get target => _target; | 12047 Expression get target => _target; |
| 12051 | 12048 |
| 12052 /** | 12049 /** |
| 12053 * Return `true` if this expression is cascaded. If it is, then the target of
this | 12050 * Return `true` if this expression is cascaded. If it is, then the target of
this |
| 12054 * expression is not stored locally but is stored in the nearest ancestor that
is a | 12051 * expression is not stored locally but is stored in the nearest ancestor that
is a |
| 12055 * [CascadeExpression]. | 12052 * [CascadeExpression]. |
| 12056 * | 12053 * |
| 12057 * @return `true` if this expression is cascaded | 12054 * @return `true` if this expression is cascaded |
| 12058 */ | 12055 */ |
| (...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14176 @override | 14173 @override |
| 14177 void visitChildren(AstVisitor visitor) { | 14174 void visitChildren(AstVisitor visitor) { |
| 14178 safelyVisitChild(_operand, visitor); | 14175 safelyVisitChild(_operand, visitor); |
| 14179 } | 14176 } |
| 14180 | 14177 |
| 14181 /** | 14178 /** |
| 14182 * If the AST structure has been resolved, and the function being invoked is k
nown based on | 14179 * If the AST structure has been resolved, and the function being invoked is k
nown based on |
| 14183 * propagated type information, then return the parameter element representing
the parameter to | 14180 * propagated type information, then return the parameter element representing
the parameter to |
| 14184 * which the value of the operand will be bound. Otherwise, return `null`. | 14181 * which the value of the operand will be bound. Otherwise, return `null`. |
| 14185 * | 14182 * |
| 14186 * This method is only intended to be used by [Expression#getPropagatedParamet
erElement]. | 14183 * This method is only intended to be used by [Expression.propagatedParameterE
lement]. |
| 14187 * | 14184 * |
| 14188 * @return the parameter element representing the parameter to which the value
of the right | 14185 * @return the parameter element representing the parameter to which the value
of the right |
| 14189 * operand will be bound | 14186 * operand will be bound |
| 14190 */ | 14187 */ |
| 14191 ParameterElement get propagatedParameterElementForOperand { | 14188 ParameterElement get propagatedParameterElementForOperand { |
| 14192 if (_propagatedElement == null) { | 14189 if (_propagatedElement == null) { |
| 14193 return null; | 14190 return null; |
| 14194 } | 14191 } |
| 14195 List<ParameterElement> parameters = _propagatedElement.parameters; | 14192 List<ParameterElement> parameters = _propagatedElement.parameters; |
| 14196 if (parameters.length < 1) { | 14193 if (parameters.length < 1) { |
| 14197 return null; | 14194 return null; |
| 14198 } | 14195 } |
| 14199 return parameters[0]; | 14196 return parameters[0]; |
| 14200 } | 14197 } |
| 14201 | 14198 |
| 14202 /** | 14199 /** |
| 14203 * If the AST structure has been resolved, and the function being invoked is k
nown based on static | 14200 * If the AST structure has been resolved, and the function being invoked is k
nown based on static |
| 14204 * type information, then return the parameter element representing the parame
ter to which the | 14201 * type information, then return the parameter element representing the parame
ter to which the |
| 14205 * value of the operand will be bound. Otherwise, return `null`. | 14202 * value of the operand will be bound. Otherwise, return `null`. |
| 14206 * | 14203 * |
| 14207 * This method is only intended to be used by [Expression#getStaticParameterEl
ement]. | 14204 * This method is only intended to be used by [Expression.staticParameterEleme
nt]. |
| 14208 * | 14205 * |
| 14209 * @return the parameter element representing the parameter to which the value
of the right | 14206 * @return the parameter element representing the parameter to which the value
of the right |
| 14210 * operand will be bound | 14207 * operand will be bound |
| 14211 */ | 14208 */ |
| 14212 ParameterElement get staticParameterElementForOperand { | 14209 ParameterElement get staticParameterElementForOperand { |
| 14213 if (_staticElement == null) { | 14210 if (_staticElement == null) { |
| 14214 return null; | 14211 return null; |
| 14215 } | 14212 } |
| 14216 List<ParameterElement> parameters = _staticElement.parameters; | 14213 List<ParameterElement> parameters = _staticElement.parameters; |
| 14217 if (parameters.length < 1) { | 14214 if (parameters.length < 1) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14351 @override | 14348 @override |
| 14352 void visitChildren(AstVisitor visitor) { | 14349 void visitChildren(AstVisitor visitor) { |
| 14353 safelyVisitChild(_operand, visitor); | 14350 safelyVisitChild(_operand, visitor); |
| 14354 } | 14351 } |
| 14355 | 14352 |
| 14356 /** | 14353 /** |
| 14357 * If the AST structure has been resolved, and the function being invoked is k
nown based on | 14354 * If the AST structure has been resolved, and the function being invoked is k
nown based on |
| 14358 * propagated type information, then return the parameter element representing
the parameter to | 14355 * propagated type information, then return the parameter element representing
the parameter to |
| 14359 * which the value of the operand will be bound. Otherwise, return `null`. | 14356 * which the value of the operand will be bound. Otherwise, return `null`. |
| 14360 * | 14357 * |
| 14361 * This method is only intended to be used by [Expression#getPropagatedParamet
erElement]. | 14358 * This method is only intended to be used by [Expression.propagatedParameterE
lement]. |
| 14362 * | 14359 * |
| 14363 * @return the parameter element representing the parameter to which the value
of the right | 14360 * @return the parameter element representing the parameter to which the value
of the right |
| 14364 * operand will be bound | 14361 * operand will be bound |
| 14365 */ | 14362 */ |
| 14366 ParameterElement get propagatedParameterElementForOperand { | 14363 ParameterElement get propagatedParameterElementForOperand { |
| 14367 if (_propagatedElement == null) { | 14364 if (_propagatedElement == null) { |
| 14368 return null; | 14365 return null; |
| 14369 } | 14366 } |
| 14370 List<ParameterElement> parameters = _propagatedElement.parameters; | 14367 List<ParameterElement> parameters = _propagatedElement.parameters; |
| 14371 if (parameters.length < 1) { | 14368 if (parameters.length < 1) { |
| 14372 return null; | 14369 return null; |
| 14373 } | 14370 } |
| 14374 return parameters[0]; | 14371 return parameters[0]; |
| 14375 } | 14372 } |
| 14376 | 14373 |
| 14377 /** | 14374 /** |
| 14378 * If the AST structure has been resolved, and the function being invoked is k
nown based on static | 14375 * If the AST structure has been resolved, and the function being invoked is k
nown based on static |
| 14379 * type information, then return the parameter element representing the parame
ter to which the | 14376 * type information, then return the parameter element representing the parame
ter to which the |
| 14380 * value of the operand will be bound. Otherwise, return `null`. | 14377 * value of the operand will be bound. Otherwise, return `null`. |
| 14381 * | 14378 * |
| 14382 * This method is only intended to be used by [Expression#getStaticParameterEl
ement]. | 14379 * This method is only intended to be used by [Expression.staticParameterEleme
nt]. |
| 14383 * | 14380 * |
| 14384 * @return the parameter element representing the parameter to which the value
of the right | 14381 * @return the parameter element representing the parameter to which the value
of the right |
| 14385 * operand will be bound | 14382 * operand will be bound |
| 14386 */ | 14383 */ |
| 14387 ParameterElement get staticParameterElementForOperand { | 14384 ParameterElement get staticParameterElementForOperand { |
| 14388 if (_staticElement == null) { | 14385 if (_staticElement == null) { |
| 14389 return null; | 14386 return null; |
| 14390 } | 14387 } |
| 14391 List<ParameterElement> parameters = _staticElement.parameters; | 14388 List<ParameterElement> parameters = _staticElement.parameters; |
| 14392 if (parameters.length < 1) { | 14389 if (parameters.length < 1) { |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14598 */ | 14595 */ |
| 14599 SimpleIdentifier get propertyName => _propertyName; | 14596 SimpleIdentifier get propertyName => _propertyName; |
| 14600 | 14597 |
| 14601 /** | 14598 /** |
| 14602 * Return the expression used to compute the receiver of the invocation. If th
is invocation is not | 14599 * Return the expression used to compute the receiver of the invocation. If th
is invocation is not |
| 14603 * part of a cascade expression, then this is the same as [getTarget]. If this
invocation | 14600 * part of a cascade expression, then this is the same as [getTarget]. If this
invocation |
| 14604 * is part of a cascade expression, then the target stored with the cascade ex
pression is | 14601 * is part of a cascade expression, then the target stored with the cascade ex
pression is |
| 14605 * returned. | 14602 * returned. |
| 14606 * | 14603 * |
| 14607 * @return the expression used to compute the receiver of the invocation | 14604 * @return the expression used to compute the receiver of the invocation |
| 14608 * @see #getTarget() | 14605 * See [target]. |
| 14609 */ | 14606 */ |
| 14610 Expression get realTarget { | 14607 Expression get realTarget { |
| 14611 if (isCascaded) { | 14608 if (isCascaded) { |
| 14612 AstNode ancestor = parent; | 14609 AstNode ancestor = parent; |
| 14613 while (ancestor is! CascadeExpression) { | 14610 while (ancestor is! CascadeExpression) { |
| 14614 if (ancestor == null) { | 14611 if (ancestor == null) { |
| 14615 return _target; | 14612 return _target; |
| 14616 } | 14613 } |
| 14617 ancestor = ancestor.parent; | 14614 ancestor = ancestor.parent; |
| 14618 } | 14615 } |
| 14619 return (ancestor as CascadeExpression).target; | 14616 return (ancestor as CascadeExpression).target; |
| 14620 } | 14617 } |
| 14621 return _target; | 14618 return _target; |
| 14622 } | 14619 } |
| 14623 | 14620 |
| 14624 /** | 14621 /** |
| 14625 * Return the expression computing the object defining the property being acce
ssed, or | 14622 * Return the expression computing the object defining the property being acce
ssed, or |
| 14626 * `null` if this property access is part of a cascade expression. | 14623 * `null` if this property access is part of a cascade expression. |
| 14627 * | 14624 * |
| 14628 * @return the expression computing the object defining the property being acc
essed | 14625 * @return the expression computing the object defining the property being acc
essed |
| 14629 * @see #getRealTarget() | 14626 * See [realTarget]. |
| 14630 */ | 14627 */ |
| 14631 Expression get target => _target; | 14628 Expression get target => _target; |
| 14632 | 14629 |
| 14633 @override | 14630 @override |
| 14634 bool get isAssignable => true; | 14631 bool get isAssignable => true; |
| 14635 | 14632 |
| 14636 /** | 14633 /** |
| 14637 * Return `true` if this expression is cascaded. If it is, then the target of
this | 14634 * Return `true` if this expression is cascaded. If it is, then the target of
this |
| 14638 * expression is not stored locally but is stored in the nearest ancestor that
is a | 14635 * expression is not stored locally but is stored in the nearest ancestor that
is a |
| 14639 * [CascadeExpression]. | 14636 * [CascadeExpression]. |
| (...skipping 4925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19565 } | 19562 } |
| 19566 | 19563 |
| 19567 @override | 19564 @override |
| 19568 void visitChildren(AstVisitor visitor) { | 19565 void visitChildren(AstVisitor visitor) { |
| 19569 super.visitChildren(visitor); | 19566 super.visitChildren(visitor); |
| 19570 safelyVisitChild(_uri, visitor); | 19567 safelyVisitChild(_uri, visitor); |
| 19571 } | 19568 } |
| 19572 } | 19569 } |
| 19573 | 19570 |
| 19574 /** | 19571 /** |
| 19575 * Validation codes returned by [UriBasedDirective#validate]. | 19572 * Validation codes returned by [UriBasedDirective.validate]. |
| 19576 */ | 19573 */ |
| 19577 class UriValidationCode extends Enum<UriValidationCode> { | 19574 class UriValidationCode extends Enum<UriValidationCode> { |
| 19578 static const UriValidationCode INVALID_URI = const UriValidationCode('INVALID_
URI', 0); | 19575 static const UriValidationCode INVALID_URI = const UriValidationCode('INVALID_
URI', 0); |
| 19579 | 19576 |
| 19580 static const UriValidationCode URI_WITH_INTERPOLATION = const UriValidationCod
e('URI_WITH_INTERPOLATION', 1); | 19577 static const UriValidationCode URI_WITH_INTERPOLATION = const UriValidationCod
e('URI_WITH_INTERPOLATION', 1); |
| 19581 | 19578 |
| 19582 static const UriValidationCode URI_WITH_DART_EXT_SCHEME = const UriValidationC
ode('URI_WITH_DART_EXT_SCHEME', 2); | 19579 static const UriValidationCode URI_WITH_DART_EXT_SCHEME = const UriValidationC
ode('URI_WITH_DART_EXT_SCHEME', 2); |
| 19583 | 19580 |
| 19584 static const List<UriValidationCode> values = const [ | 19581 static const List<UriValidationCode> values = const [ |
| 19585 INVALID_URI, | 19582 INVALID_URI, |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20260 _elements[index] = node; | 20257 _elements[index] = node; |
| 20261 } | 20258 } |
| 20262 void clear() { | 20259 void clear() { |
| 20263 _elements = <E> []; | 20260 _elements = <E> []; |
| 20264 } | 20261 } |
| 20265 int get length => _elements.length; | 20262 int get length => _elements.length; |
| 20266 void set length(int value) { | 20263 void set length(int value) { |
| 20267 throw new UnsupportedError("Cannot resize NodeList."); | 20264 throw new UnsupportedError("Cannot resize NodeList."); |
| 20268 } | 20265 } |
| 20269 } | 20266 } |
| OLD | NEW |