grain icon indicating copy to clipboard operation
grain copied to clipboard

feat: Generate tree-sitter grammar from parser

Open phated opened this issue 8 months ago • 0 comments

This is my initial experimentation to figure out if we can use MenhirSdk and the cmly file it can generate to automatically output a tree-sitter grammar.

It's a little annoying because you need to specify the RegExp pattern for each token in the parser, as that logic is actually done by sedlex_ppx in the lexer, but tree-sitter generates a combined lexer/parser given a JavaScript RegExp 😦.

If we can actually get this working, we could possibly throw away all our formatter code and just rely on Topiary.

phated avatar Oct 09 '23 21:10 phated