Tools

AST operations

AST operations match language structure rather than byte sequences.

ast_search uses parseable syntax patterns and metavariables to locate constructs across supported files. Repeated metavariables require identical matched nodes.

Rewrite

ast_rewrite substitutes captured nodes one-for-one. Use it for codemods where text replacement would hit comments, strings, shadowed names, or unrelated syntax.

Boundaries

A rewrite operates in one language at a time and must parse as a valid node. Cross-file symbol renames require semantic references when a language service is available.

Stay in the loop. Never miss out.

Subscribe to our newsletter and unlock Wisent insights.