logoalt Hacker News

VorpalWaytoday at 2:48 PM1 replyview on HN

Not the same level of sophistication, but ast-grep allows this for far more languages, since it is based on the tree-sitter parser library. I have used it with some success on C++. Of course it only works on the AST level, and C++ famously need types for correct parsing, so it sometimes fall short (also on macros).

https://ast-grep.github.io/


Replies

gritzkotoday at 4:28 PM

I am working on AST level revision control and yes, macros make life difficult. On the other hand, merging/diffing on the AST level is fun.

https://replicated.wiki/blog/partI.html

show 1 reply