[Top][All Lists]

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

Re: How to add pseudo vector types

From: Eli Zaretskii
Subject: Re: How to add pseudo vector types
Date: Sat, 24 Jul 2021 21:21:27 +0300

> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 24 Jul 2021 14:06:52 -0400
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
>  cpitclaudel@gmail.com,
>  emacs-devel@gnu.org
> > We should ask the TS developers to provide a way of specifying custom
> > memory allocation/release function as part of TS initialization.  It
> > is a feature many packages provide.
> I commented on tree-sitter’s 1.0 checklist.


> > Isn't there a better way of updating those than manually take them out
> > of the TS grammar?  Maybe write a short program linked against TS that
> > would spill them in some format that's convenient to use?  Manual
> > updates are a serious maintenance burden.
> How does this convenient format looks like, in your mind? The grammar 
> definition is already the “source”, I don’t see a way to magically make it 
> easier to work with. What does “manual updates” refer to? If you mean 
> updating patterns like
> (init_declarator
>  declarator: (identifier) @font-lock-variable-name-face)
> (parameter_declaration
>  declarator: (identifier) @font-lock-variable-name-face)
> when a language’s grammar changes, I don’t think we need to update them 
> often, or ever. And It is not harder than updating font-lock-keywords when a 
> language adds a new fancy syntax.

It isn't an immediate problem, so we can delay it for later.

However, I do worry about the ability to update this in some
non-manual way.  Take for example the way we update our character
databases when Unicode adds more characters/scripts: we use the data
files distributed by the Unicode Consortium and process them with
scripts in admin/unidata to produce intermediate files in a format
convenient for processing by Emacs, then we process those intermediate
files as part of building Emacs.  Unicode files change maybe or twice
a year, but still, doing all those changes manually would be a burden.

reply via email to

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