A read-and-write visitor.
Subclasses can be used to modify an AST in-place.
To handle specific node types add methods like visitPattern.
Then, to descend into children call genericVisit.
Visiting methods must implement the following interface:
interface TransformingMethod {
(this: Transformer, node: BaseNode): BaseNode | undefined;
}
The returned node wili replace the original one in the AST. Return
undefined to remove the node instead.
A read-and-write visitor.
Subclasses can be used to modify an AST in-place.
To handle specific node types add methods like
visitPattern. Then, to descend into children callgenericVisit.Visiting methods must implement the following interface:
The returned node wili replace the original one in the AST. Return
undefinedto remove the node instead.