3 ms·
> Does the rewrite code also have to be syntactically correct or is that a simple text replacement because that's what I see as the main impediment; if I'm usin
by morgante 3y ago
> Does the rewrite code also have to be syntactically correct or is that a simple text replacement because that's what I see as the main impediment; if I'm using the sqlite grammar to parse and produce postgresql output, the output won't conform to the grammar.
No, we don't require the output code to be syntactically correct. You can use the raw`code` modified to indicate a raw text replacement: https://docs.grit.io/language/patterns#raw-output https://docs.grit.io/language/patterns#raw-output
> Also how do I dynamically load custom tree-sitter grammars like in ast-grep?
We don't currently support dynamically loading grammars, mainly because our metavariable approach requires some modifications to the grammar.
- snthpy 3y agoThank you. The raw"..." directive looks perfect for what I'm looking for.