Code Transformation โ
Problem โ
Automated rewrites (migrations, codemods) must preserve everything they do not intend to change.
Why tree-sitter.zig helps โ
Match ranges are exact, unaffected regions reuse their subtrees, and reparsing the result verifies the output parses cleanly.
API โ
Query matches โ text edits โ Parser.parse โ hasError check on the result.
Architecture โ
text
Match โ compute edits โ apply โ reparse โ verify no errors