Closed pfoerster closed 3 months ago
(Disregard my suggestion about grammar.json
; it doesn't seem to make a serious difference for this parser -- it did for other, smaller ones. So there's no big benefit for this parser; it's mostly useful for languages that import other languages, where generating from grammar.js
-- but not from grammar.json
-- requires npm
. I was hoping to be able to unify this in nvim-treesitter to always use tree-sitter generate src/grammar.json
, but that is not necessarily a compelling argument for you.)
@clason Well, it looks like checking in parser.c
still seems to be the recommended way so I guess I'll keep the existing structure for now to avoid the breaking changes downstream.
Also, consider https://github.com/tree-sitter/workflows; see https://github.com/tree-sitter-grammars/template
Thanks, these look very good!
@clason Well, it looks like checking in parser.c still seems to be the recommended way so I guess I'll keep the existing structure for now to avoid the breaking changes downstream.
Well, officially the recommended way is
parser.c
out of the repo;parser.c
.What's not yet done is adding support to tree-sitter
CLI to make 2. easier. So I wouldn't worry too much; now that I know what's happening I can easily adjust in nvim-treesitter (which will also move to preferring releases over YOLO master).
Note: this is a breaking change for downstream consumers, better mark it as such. This is recommended by upstream, but only in combination with versioned releases (which do contain
parser.c
so downstream can build parsers without having to require users to installtree-sitter
CLI).And could you please keep
grammar.json
committed? This is much smaller, has meaningful diffs, and allows faster generation thangrammar.js
(tree-sitter generate src/grammar.json
).