emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter integration on feature/tree-sitter


From: Yuan Fu
Subject: Re: Tree-sitter integration on feature/tree-sitter
Date: Thu, 16 Jun 2022 12:16:19 -0700


> On May 13, 2022, at 5:04 PM, Yuan Fu <casouri@gmail.com> wrote:
> 
> 
> 
>> On May 13, 2022, at 3:41 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> 
>>> From: Yoav Marco <yoavm448@gmail.com>
>>> Cc: casouri@gmail.com, emacs-devel@gnu.org
>>> Date: Fri, 13 May 2022 11:42:04 +0300
>>> 
>>> Eli Zaretskii <eliz@gnu.org> writes:
>>> 
>>>> Is it true that there's just one query for each PL mode, and it is
>>>> fixed (doesn't change) and doesn't depend on the buffer contents in
>>>> any way? If that is true, the major mode could compile the query
>>>> whenever it is initialized, and then reuse it in every buffer that is
>>>> under that major mode.
>>> 
>>> It's correct, though there might be more than one if a mode wants to
>>> offer fontification options users can toggle. But yeah, the major mode
>>> could compile its queries when initialized. I'm in favor of this too.
>> 
>> Then let's do that. Yuan, are there any issues with implementing
>> this?
> 
> No, it’s fairly straightforward. Added to todo-list ;-)

I’ve added support for compiling queries. Try this new benchmark that I’ve 
attached. You can see three forms, each for tree-sitter, tree-sitter compiled, 
and font-lock. The compiled one should be fairly fast. I haven’t wrote 
benchmarks that can be added to tests yet.

Yuan

Attachment: bench.zip
Description: Zip archive


reply via email to

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