GNU bug report logs -
#61849
29.0.60; Unable to use treesit-install-language-grammar because repo doesn't have parser.c
Previous Next
Full log
View this message in rfc822 format
> Date: Mon, 20 Mar 2023 22:01:15 +0000
> From: Gregory Heytings <gregory <at> heytings.org>
> cc: Dmitry Gutov <dgutov <at> yandex.ru>, mishazharov1 <at> gmail.com, casouri <at> gmail.com,
> 61849 <at> debbugs.gnu.org
>
>
> >> Suppose the repositories remove the generated grammar files. What would
> >> be sufficient for us to regenerate them?
> >
> > I hope someone will write a generation tool in Emacs Lisp.
> >
>
> That can't possibly happen, IMO. Generating the grammar.json files from
> the grammar.js files with an Emacs Lisp program would amount to implement
> a JavaScript interpreter in Emacs Lisp.
So you are saying that generating a parser would need a JavaScript
interpreter as part of the generation? Does tree-sitter-cli tool
invoke it, then (I didn't study its sources)?
> And generating the parser.c files from the grammar.json files would
> amount to reimplement the generator, which is about 13500 lines of
> non-trivial Rust code, in Emacs Lisp.
That's what I hoped someone will do, yes. It's a non-trivial job, but
surely isn't impossible. Reimplementing that in some other widely
available language, like Python or Perl, would also do. Or maybe the
Rust front-end to GCC will become available soon enough. Or something.
This bug report was last modified 83 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.