emacs-devel
[Top][All Lists]
Advanced

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

Re: How to add pseudo vector types


From: Yuan Fu
Subject: Re: How to add pseudo vector types
Date: Mon, 26 Jul 2021 15:06:14 -0400

> 
>>> If we let TS look where it wants, we will lose the ability to restrict
>>> it to a certain part of the buffer text.  This is needed at least for
>>> some specialized modes, and is generally desirable, as it gives Lisp
>>> programs an easy way to impose such restrictions whenever they need.
>> 
>> Tree-sitter lets you set ranges for a parser to limit it self within, in 
>> order to support multi-language files.
> 
> That's okay, but why would we want to expose this to Lisp as the means
> to restrict the accessible portion, when we already have such a means?

Tree-sitter lets you set multiple discontinuous ranges, whereas narrowing can 
only narrow to a single continuous range. Multiple discontinuous range is much 
more useful for HTML+CSS+JS, or PHP + HML.

Yuan


reply via email to

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