-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
feat(parser): implement GritQL parsing #1922
Conversation
✅ Deploy Preview for biomejs canceled.
|
CodSpeed Performance ReportMerging #1922 will degrade performances by 8.14%Comparing Summary
Benchmarks breakdown
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to ask you to break down this PR in smaller PRs. It's impossible to review it. Sorry about that.
Some advice on how to break it down:
- start with a PR of the grammar and its code generation;
- then a PR that contains the parsing only;
- the formatter is not needed, the code-generation of the formatter is done a different step, which can be ignored. If you wish to add it, it can be done in a separate PR
No worries! I think I'll first get the parser complete, since at least initially I sometimes needed to tweak the grammar based on what I discovered implemented the parser. It's probably mostly stable by now, but if you don't mind I'll just use this one to track my progress, and then split things to get it reviewed and merged. |
7a0ec0c
to
6224d44
Compare
I created test cases out of most of the snippets in the Grit docs and they all parse. Still have some FIXMEs in there and I think I might have some precedence issues still, but next step will be splitting this PR :) |
Obsoleted by #1998 . |
Summary
Based on the open-source GritQL grammar, this PR implements a parser for GritQL in Biome.
I'll admit I had underestimated how much manual parsing logic needed to be implemented, but I've gotten the hang of it and progress is moving fast now.
It's nice that the codegen also seems to generate most of the formatter already, but I have to take a closer look still to see it really works.
TODO:
Test Plan
Still adding test cases.