Chromium Code Reviews| 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 /** | 5 /** |
| 6 * Defines the AST model. The AST (Abstract Syntax Tree) model describes the | 6 * Defines the AST model. The AST (Abstract Syntax Tree) model describes the |
| 7 * syntactic (as opposed to semantic) structure of Dart code. The semantic | 7 * syntactic (as opposed to semantic) structure of Dart code. The semantic |
| 8 * structure of the code is modeled by the | 8 * structure of the code is modeled by the |
| 9 * [element model](../element/element.dart). | 9 * [element model](../element/element.dart). |
| 10 * | 10 * |
| (...skipping 4956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4967 } | 4967 } |
| 4968 | 4968 |
| 4969 /** | 4969 /** |
| 4970 * The invocation of a function or method; either a | 4970 * The invocation of a function or method; either a |
| 4971 * [FunctionExpressionInvocation] or a [MethodInvocation]. | 4971 * [FunctionExpressionInvocation] or a [MethodInvocation]. |
| 4972 * | 4972 * |
| 4973 * Clients may not extend, implement or mix-in this class. | 4973 * Clients may not extend, implement or mix-in this class. |
| 4974 */ | 4974 */ |
| 4975 abstract class InvocationExpression extends Expression { | 4975 abstract class InvocationExpression extends Expression { |
| 4976 /** | 4976 /** |
| 4977 * Return the list of arguments to the method. | |
| 4978 */ | |
| 4979 ArgumentList get argumentList; | |
| 4980 | |
| 4981 /** | |
| 4982 * The expression that identifies the function or method being invoked. | |
| 4983 * For example: | |
| 4984 * | |
| 4985 * (o.m)<TArgs>(args); // target will be `o.m` | |
| 4986 * o.m<TArgs>(args); // target will be `m` | |
| 4987 * | |
| 4988 * In either case, the [function.staticType] will be the | |
| 4989 * [staticInvokeType] before applying type arguments `TArgs`. Similarly, | |
| 4990 * [function.propagatedType] will be the [propagatedInvokeType] | |
| 4991 * before applying type arguments `TArgs`. | |
| 4992 */ | |
| 4993 Expression get function; | |
| 4994 | |
| 4995 /** | |
| 4977 * Return the function type of the invocation based on the propagated type | 4996 * Return the function type of the invocation based on the propagated type |
| 4978 * information, or `null` if the AST structure has not been resolved, or if | 4997 * information, or `null` if the AST structure has not been resolved, or if |
| 4979 * the invoke could not be resolved. | 4998 * the invoke could not be resolved. |
| 4980 * | 4999 * |
| 4981 * This will usually be a [FunctionType], but it can also be an | 5000 * This will usually be a [FunctionType], but it can also be an |
| 4982 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` | 5001 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` |
| 4983 * interface type that implements `Function`. | 5002 * interface type that implements `Function`. |
| 4984 */ | 5003 */ |
| 4985 DartType propagatedInvokeType; | 5004 DartType get propagatedInvokeType; |
| 5005 | |
| 5006 /** | |
| 5007 * Sets the function type of the invocation based on the propagated type | |
| 5008 * information. | |
| 5009 */ | |
| 5010 void set propagatedInvokeType(DartType value); | |
|
Brian Wilkerson
2016/02/23 00:11:08
Do we need the setters on the interface, or can we
Jennifer Messerly
2016/02/23 00:49:52
Currently, yes. Otherwise, the only way to set it
| |
| 4986 | 5011 |
| 4987 /** | 5012 /** |
| 4988 * Return the function type of the invocation based on the static type | 5013 * Return the function type of the invocation based on the static type |
| 4989 * information, or `null` if the AST structure has not been resolved, or if | 5014 * information, or `null` if the AST structure has not been resolved, or if |
| 4990 * the invoke could not be resolved. | 5015 * the invoke could not be resolved. |
| 4991 * | 5016 * |
| 4992 * This will usually be a [FunctionType], but it can also be an | 5017 * This will usually be a [FunctionType], but it can also be an |
| 4993 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` | 5018 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` |
| 4994 * interface type that implements `Function`. | 5019 * interface type that implements `Function`. |
| 4995 */ | 5020 */ |
| 4996 DartType staticInvokeType; | 5021 DartType get staticInvokeType; |
| 4997 | 5022 |
| 4998 /** | 5023 /** |
| 4999 * Return the list of arguments to the method. | 5024 * Sets the function type of the invocation based on the static type |
| 5025 * information. | |
| 5000 */ | 5026 */ |
| 5001 ArgumentList get argumentList; | 5027 void set staticInvokeType(DartType value); |
| 5002 | |
| 5003 /** | |
| 5004 * The expression that identifies the function or method being invoked. | |
| 5005 * For example: | |
| 5006 * | |
| 5007 * (o.m)<TArgs>(args); // target will be `o.m` | |
| 5008 * o.m<TArgs>(args); // target will be `m` | |
| 5009 * | |
| 5010 * In either case, the [function.staticType] will be the | |
| 5011 * [staticInvokeType] before applying type arguments `TArgs`. Similarly, | |
| 5012 * [function.propagatedType] will be the [propagatedInvokeType] | |
| 5013 * before applying type arguments `TArgs`. | |
| 5014 */ | |
| 5015 Expression get function; | |
| 5016 | 5028 |
| 5017 /** | 5029 /** |
| 5018 * Return the type arguments to be applied to the method being invoked, or | 5030 * Return the type arguments to be applied to the method being invoked, or |
| 5019 * `null` if no type arguments were provided. | 5031 * `null` if no type arguments were provided. |
| 5020 */ | 5032 */ |
| 5021 TypeArgumentList get typeArguments; | 5033 TypeArgumentList get typeArguments; |
| 5022 } | 5034 } |
| 5023 | 5035 |
| 5024 /** | 5036 /** |
| 5025 * An is expression. | 5037 * An is expression. |
| (...skipping 3043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8069 /** | 8081 /** |
| 8070 * Return the 'yield' keyword. | 8082 * Return the 'yield' keyword. |
| 8071 */ | 8083 */ |
| 8072 Token get yieldKeyword; | 8084 Token get yieldKeyword; |
| 8073 | 8085 |
| 8074 /** | 8086 /** |
| 8075 * Return the 'yield' keyword to the given [token]. | 8087 * Return the 'yield' keyword to the given [token]. |
| 8076 */ | 8088 */ |
| 8077 void set yieldKeyword(Token token); | 8089 void set yieldKeyword(Token token); |
| 8078 } | 8090 } |
| OLD | NEW |