unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Christian Johansson <christian@cvj.se>
Cc: "Eli Zaretskii" <eliz@gnu.org>,
	"Daniel Martín" <mardani29@yahoo.es>,
	"Stefan Monnier" <monnier@iro.umontreal.ca>,
	"Emacs developers" <emacs-devel@gnu.org>
Subject: Re: New package emacs-parser-generator
Date: Wed, 1 Dec 2021 00:39:00 -0800	[thread overview]
Message-ID: <7C564949-3B67-459F-B149-AE17CC371781@gmail.com> (raw)
In-Reply-To: <12F88CF0-4706-4C10-A76D-52CC0EEF8D0C@cvj.se>



> 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	other threads:[~2021-12-01  8:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27 21:40 New package emacs-parser-generator Christian Johansson
2021-11-28  7:01 ` Eli Zaretskii
2021-11-28  7:22   ` Christian Johansson
2021-11-28 13:24     ` Stefan Monnier
2021-11-28 13:45       ` Christian Johansson
2021-11-28 23:46         ` Daniel Martín
2021-11-29 12:30           ` Eli Zaretskii
2021-11-29 13:09             ` Christian Johansson
2021-11-29 19:22               ` Yuan Fu
2021-12-01  7:52                 ` Christian Johansson
2021-12-01  8:39                   ` Yuan Fu [this message]
2021-12-01  8:51                     ` Christian Johansson
2021-12-01 13:45                       ` Stefan Monnier
2021-12-01 14:10                         ` Christian Johansson
2021-12-01 19:25                       ` Yuan Fu
2021-12-01 19:44                         ` Christian Johansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7C564949-3B67-459F-B149-AE17CC371781@gmail.com \
    --to=casouri@gmail.com \
    --cc=christian@cvj.se \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mardani29@yahoo.es \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).