public class ReturnAdderForClosures
extends CodeVisitorSupport
Adds explicit return statements to implicit return points in a closure. This is necessary since tail-recursion is detected by having the recursive call within the return statement.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
visitClosureExpression(ClosureExpression expression)* Visits a ClosureExpression, traversing parameter initializers and the closure code block. * *
|
|
public void |
visitMethod(MethodNode method)Adds explicit return statements to closures contained in the supplied method. |
* Visits a ClosureExpression, traversing parameter initializers and the closure code block. * *
expression - the closure expressionAdds explicit return statements to closures contained in the supplied method.
method - the method whose closures should be normalized