| 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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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#getPropagatedParamet
erElement]. |
| 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 if (_propagatedElement == null) { | 929 ExecutableElement executableElement = null; |
| 930 if (_propagatedElement != null) { |
| 931 executableElement = _propagatedElement; |
| 932 } else { |
| 933 if (_leftHandSide is Identifier) { |
| 934 Identifier identifier = _leftHandSide as Identifier; |
| 935 Element leftElement = identifier.propagatedElement; |
| 936 if (leftElement is ExecutableElement) { |
| 937 executableElement = leftElement; |
| 938 } |
| 939 } |
| 940 if (_leftHandSide is PropertyAccess) { |
| 941 SimpleIdentifier identifier = (_leftHandSide as PropertyAccess).property
Name; |
| 942 Element leftElement = identifier.propagatedElement; |
| 943 if (leftElement is ExecutableElement) { |
| 944 executableElement = leftElement; |
| 945 } |
| 946 } |
| 947 } |
| 948 if (executableElement == null) { |
| 930 return null; | 949 return null; |
| 931 } | 950 } |
| 932 List<ParameterElement> parameters = _propagatedElement.parameters; | 951 List<ParameterElement> parameters = executableElement.parameters; |
| 933 if (parameters.length < 1) { | 952 if (parameters.length < 1) { |
| 934 return null; | 953 return null; |
| 935 } | 954 } |
| 936 return parameters[0]; | 955 return parameters[0]; |
| 937 } | 956 } |
| 938 | 957 |
| 939 /** | 958 /** |
| 940 * 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 |
| 941 * 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 |
| 942 * value of the right operand will be bound. Otherwise, return `null`. | 961 * value of the right operand will be bound. Otherwise, return `null`. |
| 943 * | 962 * |
| 944 * This method is only intended to be used by [Expression#getStaticParameterEl
ement]. | 963 * This method is only intended to be used by [Expression#getStaticParameterEl
ement]. |
| 945 * | 964 * |
| 946 * @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 |
| 947 * operand will be bound | 966 * operand will be bound |
| 948 */ | 967 */ |
| 949 ParameterElement get staticParameterElementForRightHandSide { | 968 ParameterElement get staticParameterElementForRightHandSide { |
| 950 if (_staticElement == null) { | 969 ExecutableElement executableElement = null; |
| 970 if (_staticElement != null) { |
| 971 executableElement = _staticElement; |
| 972 } else { |
| 973 if (_leftHandSide is Identifier) { |
| 974 Element leftElement = (_leftHandSide as Identifier).staticElement; |
| 975 if (leftElement is ExecutableElement) { |
| 976 executableElement = leftElement; |
| 977 } |
| 978 } |
| 979 if (_leftHandSide is PropertyAccess) { |
| 980 Element leftElement = (_leftHandSide as PropertyAccess).propertyName.sta
ticElement; |
| 981 if (leftElement is ExecutableElement) { |
| 982 executableElement = leftElement; |
| 983 } |
| 984 } |
| 985 } |
| 986 if (executableElement == null) { |
| 951 return null; | 987 return null; |
| 952 } | 988 } |
| 953 List<ParameterElement> parameters = _staticElement.parameters; | 989 List<ParameterElement> parameters = executableElement.parameters; |
| 954 if (parameters.length < 1) { | 990 if (parameters.length < 1) { |
| 955 return null; | 991 return null; |
| 956 } | 992 } |
| 957 return parameters[0]; | 993 return parameters[0]; |
| 958 } | 994 } |
| 959 } | 995 } |
| 960 | 996 |
| 961 /** | 997 /** |
| 962 * Instances of the class `AstCloner` implement an object that will clone any AS
T structure | 998 * Instances of the class `AstCloner` implement an object that will clone any AS
T structure |
| 963 * that it visits. The cloner will only clone the structure, it will not preserv
e any resolution | 999 * that it visits. The cloner will only clone the structure, it will not preserv
e any resolution |
| (...skipping 6548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7512 * | 7548 * |
| 7513 * <pre> | 7549 * <pre> |
| 7514 * functionBody ::= | 7550 * functionBody ::= |
| 7515 * [BlockFunctionBody] | 7551 * [BlockFunctionBody] |
| 7516 * | [EmptyFunctionBody] | 7552 * | [EmptyFunctionBody] |
| 7517 * | [ExpressionFunctionBody] | 7553 * | [ExpressionFunctionBody] |
| 7518 * </pre> | 7554 * </pre> |
| 7519 */ | 7555 */ |
| 7520 abstract class FunctionBody extends AstNode { | 7556 abstract class FunctionBody extends AstNode { |
| 7521 /** | 7557 /** |
| 7558 * Return the token representing the 'async' or 'sync' keyword, or `null` if t
here is no |
| 7559 * such keyword. |
| 7560 * |
| 7561 * @return the token representing the 'async' or 'sync' keyword |
| 7562 */ |
| 7563 Token get keyword => null; |
| 7564 |
| 7565 /** |
| 7566 * Return the star following the 'async' or 'sync' keyword, or `null` if there
is no star. |
| 7567 * |
| 7568 * @return the star following the 'async' or 'sync' keyword |
| 7569 */ |
| 7570 Token get star => null; |
| 7571 |
| 7572 /** |
| 7522 * Return `true` if this function body is asynchronous. | 7573 * Return `true` if this function body is asynchronous. |
| 7523 * | 7574 * |
| 7524 * @return `true` if this function body is asynchronous | 7575 * @return `true` if this function body is asynchronous |
| 7525 */ | 7576 */ |
| 7526 bool get isAsynchronous => false; | 7577 bool get isAsynchronous => false; |
| 7527 | 7578 |
| 7528 /** | 7579 /** |
| 7529 * Return `true` if this function body is a generator. | 7580 * Return `true` if this function body is a generator. |
| 7530 * | 7581 * |
| 7531 * @return `true` if this function body is a generator | 7582 * @return `true` if this function body is a generator |
| (...skipping 12001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19533 _elements[index] = node; | 19584 _elements[index] = node; |
| 19534 } | 19585 } |
| 19535 void clear() { | 19586 void clear() { |
| 19536 _elements = <E> []; | 19587 _elements = <E> []; |
| 19537 } | 19588 } |
| 19538 int get length => _elements.length; | 19589 int get length => _elements.length; |
| 19539 void set length(int value) { | 19590 void set length(int value) { |
| 19540 throw new UnsupportedError("Cannot resize NodeList."); | 19591 throw new UnsupportedError("Cannot resize NodeList."); |
| 19541 } | 19592 } |
| 19542 } | 19593 } |
| OLD | NEW |