grammars must have a file src/parser.c #7200
Replies: 4 comments
-
A treesitter grammar without a parser.c is pointless. That's a grammar that just won't work. Looking at the repo you linked it seems that the parser.c file needs to be auto generated with nodejs first. This is the case for all grammars but usually theystore the parser.c in the repo to avoid downstream users having to install npm. If you want to use this grammar with helix you need to fork it and check parser.c into git after you habe generated it. |
Beta Was this translation helpful? Give feedback.
-
Oh. Thanks for educating me. I guess that I then totally misunderstood what to look for, when assessing that it works succesfully :-P |
Beta Was this translation helpful? Give feedback.
-
Well, evidently my build succeeded. Apparently it is possible to build succesfully, when the proper libraries are available system-shared, as is the case on Debian linux - I guess with the package libtree-sitter-dev installed. |
Beta Was this translation helpful? Give feedback.
-
I briefly tried to get it working with Helix. I was able to fetch and build it without error, but on running, I ran into:
I did not debug it further. |
Beta Was this translation helpful? Give feedback.
-
Summary
helix-loader
grammar compiler supports grammars that omitsrc/scanner.c
but fail to compile ifsrc/parser.c
is missing.Reproduction Steps
I tried switching to the alternative Perl grammar in
languages.toml
:hx --grammar fetch
succeeded, buthx --grammar build
failed.Patching helix to tolerate missing parser.c makes the build succeed, (and the resulting experience is a more reliable Perl grammar - I'll file a separate issue about that).
Helix log
No response
Platform
Linux
Terminal Emulator
alacritty 0.11.0
Helix Version
helix 23.05
Beta Was this translation helpful? Give feedback.
All reactions