bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61849: 29.0.60; Unable to use treesit-install-language-grammar becau


From: Eli Zaretskii
Subject: bug#61849: 29.0.60; Unable to use treesit-install-language-grammar because repo doesn't have parser.c
Date: Tue, 21 Mar 2023 05:27:50 +0200

> Date: Mon, 20 Mar 2023 22:01:15 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: Dmitry Gutov <dgutov@yandex.ru>, mishazharov1@gmail.com, 
> casouri@gmail.com, 
>     61849@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]