@@ -51,6 +51,20 @@ class FunctionInput extends TFunctionInput {
5151 abstract string toString ( ) ;
5252}
5353
54+ module FunctionInput {
55+ /** Gets a `FunctionInput` representing the `i`th parameter. */
56+ FunctionInput parameter ( int i ) { result .isParameter ( i ) }
57+
58+ /** Gets a `FunctionInput` representing the receiver. */
59+ FunctionInput receiver ( ) { result .isReceiver ( ) }
60+
61+ /** Gets a `FunctionInput` representing the result of a single-result function. */
62+ FunctionInput functionResult ( ) { result .isResult ( ) }
63+
64+ /** Gets a `FunctionInput` representing the `i`th result. */
65+ FunctionInput functionResult ( int i ) { result .isParameter ( i ) }
66+ }
67+
5468/** A parameter position of a function, viewed as a source of input. */
5569private class ParameterInput extends FunctionInput , TInParameter {
5670 int index ;
@@ -172,6 +186,20 @@ class FunctionOutput extends TFunctionOutput {
172186 abstract string toString ( ) ;
173187}
174188
189+ module FunctionOutput {
190+ /** Gets a `FunctionOutput` representing the result of a single-result function. */
191+ FunctionOutput functionResult ( ) { result .isResult ( ) }
192+
193+ /** Gets a `FunctionOutput` representing the `i`th result. */
194+ FunctionOutput functionResult ( int i ) { result .isParameter ( i ) }
195+
196+ /** Gets a `FunctionOutput` representing the receiver after a function returns. */
197+ FunctionOutput receiver ( ) { result .isReceiver ( ) }
198+
199+ /** Gets a `FunctionOutput` representing the `i`th parameter after a function returns. */
200+ FunctionOutput parameter ( int i ) { result .isParameter ( i ) }
201+ }
202+
175203/** A result position of a function, viewed as an output. */
176204private class OutResult extends FunctionOutput , TOutResult {
177205 int index ;
0 commit comments