emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter introduction documentation


From: João Távora
Subject: Re: Tree-sitter introduction documentation
Date: Fri, 16 Dec 2022 15:48:03 +0000

On Fri, Dec 16, 2022 at 3:38 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: João Távora <joaotavora@gmail.com>
> Date: Fri, 16 Dec 2022 15:24:59 +0000
> Cc: Perry Smith <pedz@easesoftware.com>, emacs-devel@gnu.org
>
> I agree this is a problem, especially the language specific parser
> bits.  Yesterday I tried out tree sitter Emacs on my Arch system.
> Finding the tree-sitter system lib was easy enough, but finding the C++
> definition object wasn't so easy.  Eventually I made it,  but it needed
> compilation from source and a NodeJS toolchain that I didn't know
> I needed for that.

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.

Is that where you get your C++ grammar from? Or am I 
looking at an alternate outlet for slightly different grammar? 
If so where do you get your grammars from and can we 
bundle some version of them with Emacs?

João
 

reply via email to

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