emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter introduction documentation


From: Eli Zaretskii
Subject: Re: Tree-sitter introduction documentation
Date: Fri, 16 Dec 2022 18:34:49 +0200

> From: João Távora <joaotavora@gmail.com>
> Date: Fri, 16 Dec 2022 15:48:03 +0000
> Cc: pedz@easesoftware.com, emacs-devel@gnu.org
> 
>  No, you don't need a NodeJS toolchain to compile a grammar.  You only
>  need to compile the C/C++ source files that are part of the grammar,
>  and then link them into a shared library.  I use a simple Makefile to
>  build all of them, as the structure of the files and the way to
>  compile and link them are identical and boilerplate.  And I definitely
>  don't have NodeJS installed here.
> 
> I used:
> 
>    https://aur.archlinux.org/packages/tree-sitter-cpp-git
> 
> which builds with the makepkg tool, and am pretty sure
> it used NodeJS somewhere down the line.  The language
> definition it seems to use is https://github.com/tree-sitter/tree-sitter-cpp
> which also contains a log of JS stuff.

It might contain JS stuff, but you only need to compile and link the
C/C++ files in the src subdirectory.  You don't need to even look at
the rest.

> Is that where you get your C++ grammar from?

Yes.

> If so where do you get your grammars from and can we 
> bundle some version of them with Emacs?

No, we won't bundle grammar libraries with Emacs.  It is not in the
scope of the Emacs project to provide external libraries; that's for
distros to arrange and for the individual users to install by
themselves.

There are limits to what Emacs as a project can do about using
external libraries and tools.



reply via email to

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