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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider generating the grammar.js from the official language spec #36

Open
TzviPM opened this issue Oct 4, 2022 · 5 comments
Open

Comments

@TzviPM
Copy link

TzviPM commented Oct 4, 2022

Would you be open to a contribution that generates the grammar.js from the .tex file of the official specification in the dart/language repo?

@TimWhiting
Copy link
Collaborator

I think that would be great if it works well. I can help review. However note that this might be difficult since the tree sitter grammar is a different sort of grammar.

@TzviPM
Copy link
Author

TzviPM commented Oct 4, 2022

I think that would be great if it works well. I can help review. However note that this might be difficult since the tree sitter grammar is a different sort of grammar.

That makes sense. The main thing we could run into is the deep nesting discussed at https://tree-sitter.github.io/tree-sitter/creating-parsers#structuring-rules-well. I think this can be avoided by having rules that solely exist as choices between non-terminal simply not appear in the AST.

@TimWhiting
Copy link
Collaborator

I like the idea, right now I'm working on making the grammar conform more closely to the Antler spec that is checked into the dart sdk repo. After that, we can figure out whether we still want to migrate to a generator. The main problem with be figuring out the rule conflicts to insert.

@UserNobody14
Copy link
Owner

@TzviPM if you're not actively working on this, should we close the PR? As tim said, looks cool but I think there would be a bit too many conflicts atm.

@TzviPM
Copy link
Author

TzviPM commented Nov 4, 2024

I have to personal attachment to it, yeah. Feel free to close

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

No branches or pull requests

3 participants