Ce11an / tree-sitter-surrealql

SurrealQL grammar for tree-sitter
MIT License
2 stars 0 forks source link

no longer works with latest tree-sitter #9

Closed alexaandru closed 3 months ago

alexaandru commented 3 months ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.22.6 (b40f342067a89cd6331bf4c27407588320f3c263)

Describe the bug

Until the yesterday's changes I was able to generate the parser using the latest tree-sitter version. After I updated to the latest main I can no longer do that as it goes OOM in the process (I have 16GB of RAM and it's just not enough).

Steps To Reproduce/Bad Parse Tree

  1. using the latest tree-sitter;
  2. run npx tree-sitter generate.

Expected Behavior/Parse Tree

I expected generate to be successful.

Repro

No response

Ce11an commented 3 months ago

Hey @alexaandru 👋🏻

I'll look into this today. Are you able to use the compiled version for the grammar that is committed to the repository? The latest version of the grammar aligns more with the Surrealist Lezer grammar. However, if it's causing issues, I'll have to look into someone more custom.

Thanks for testing it out 🙏🏼

alexaandru commented 3 months ago

Hello,

Yes, the compiled version works fine. FWIW, I use it here https://github.com/alexaandru/go-sitter-forest and when a parser stops generating I switch to pulling in the compiled version instead. I update it almost daily so that's why I find out as soon as something stops compiling ;-)

Cheers! Alex

Ce11an commented 3 months ago

Hello,

Yes, the compiled version works fine. FWIW, I use it here https://github.com/alexaandru/go-sitter-forest and when a parser stops generating I switch to pulling in the compiled version instead. I update it almost daily so that's why I find out as soon as something stops compiling ;-)

Cheers!

Alex

Ah, interesting - I'll take a look at your project! I reckon I can minimise the amount of states that are generated, which should reduce the memory footprint when generating the parser.

Thanks for letting me know. I'll keep this issue open and post updates 👍🏻

alexaandru commented 3 months ago

You're most welcome! Have a great day!

Ce11an commented 3 months ago

Hey @alexaandru 👋🏻

I have significantly reduced the run time for tree-sitter generate. Let me know if this solved your issue. Thanks 🙏🏼

alexaandru commented 3 months ago

Hello,

Yes, it's back working now, already switched back to generating the parser :-)

Thank you & have a great day!