Transformations is the basis for all refactoring transformations.
Transformations is the basis for all refactoring transformations.
A transformation is a Function from X ⇒ Option[X], and can be
combined with other transformations in two ways:
andThen - which applies the second transformation only if the
first one was successful, i.e. returned Some(_).
orElse - which is applied only when the first transformation
returned None.
Xs are typically instances of global.Tree, but this is not
enforced. Once a transformations is assembled, it has to be applied
to a tree and its children. The function all applies a transformation
to the children of a tree. In the case of the trees, the tree has to
apply the transformation to all children and return one single tree.
Additional functions are provided that apply a transformation top-down
or bottom-up.
Transformations is the basis for all refactoring transformations.
A transformation is a Function from X ⇒ Option[X], and can be combined with other transformations in two ways: andThen - which applies the second transformation only if the first one was successful, i.e. returned Some(_). orElse - which is applied only when the first transformation returned None.
Xs are typically instances of global.Tree, but this is not enforced. Once a transformations is assembled, it has to be applied to a tree and its children. The function
all
applies a transformation to the children of a tree. In the case of the trees, the tree has to apply the transformation to all children and return one single tree.Additional functions are provided that apply a transformation top-down or bottom-up.