emacs-devel
[Top][All Lists]
Advanced

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

Re: New package emacs-parser-generator


From: Yuan Fu
Subject: Re: New package emacs-parser-generator
Date: Wed, 1 Dec 2021 00:39:00 -0800


> On Nov 30, 2021, at 11:52 PM, Christian Johansson <christian@cvj.se> wrote:
> 
> Alright, could you give some more details about when a buffer parse is 
> triggered, is it via threads, is it sometimes incremental, does it work on a 
> string copy of the buffer or on the buffer contents directly?

Tree-sitter parses incrementally, I modified primitive insert/delete functions 
in insdel.c to incrementally parse changed content. There is no need for 
threads as incremental parsing is extremely fast. We don’t make copies of 
buffer string, instead, we pass tree-sitter library a function that reads 
directly from the buffer.

> 
> Does treesitter expose a (faster) regexp matcher that perhaps can be used by 
> my library?

Not that I know of. 

IIUC, tree-sitter integration doesn’t have much to do with proposed 
emacs-parser-generator, it just exposes tree-sitter to Emacs, and adds some 
integration to font-lock and indentation that leverages tree-sitter features; 
whereas emacs-parser-generator seems to be about defining grammar and 
generating elisp parsers.

Yuan


reply via email to

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