News for hackers. Stuff that matters.
Re:Show HN: Python Source Code Refactoring Toolkit via AST by chrisphilip on Monday August 02, 2021 @12:58AM (#28033060)
I wrote a library that takes a language specification (BNF, ABNF, etc) into a custom AST in Python. Then you can define a set of visitors for the custom AST to transform the tree into whatever you want. I implemented some checks integrated into the Python type system to type-check the visitors and I've used the library to do some non-trivial manipulations before.

It's mostly a pet project and I just wanted to share since it could maybe at least inspire something.

https://github.com/chrisphilip322/prosodia

There are no comments on this comment yet.