Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Generate tree-sitter grammar from parser #1923

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

phated
Copy link
Member

@phated phated commented Oct 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants