[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: |
Tue, 03 Aug 2021 15:24:54 +0300 |
> From: Fu Yuan <casouri@gmail.com>
> Date: Tue, 3 Aug 2021 08:00:46 -0400
> Cc: stephen_leake@stephe-leake.org, cpitclaudel@gmail.com,
> monnier@iro.umontreal.ca, emacs-devel@gnu.org
>
> > Hmm... so a change that begins before the restriction and ends inside
> > the restriction will be sent as if it began at BEGV? And the rest of
> > the change will be discarded? Shouldn't you split such changes in
> > tow, send to TS the part inside the restriction, and store the rest
> > for the future, when/if the buffer is widened?
>
> Tree-sitter doesn’t care about the content in a change, it will re-scan the
> buffer content when it re-parses. We only need to inform it the range of the
> change, so it knows where to re-scan when it re-parses. When the buffer is
> widened, we will tell tree-sitter that range [BUF_BEG, BUF_BEGV] has changed,
> and it will re-scan that part when re-parsing.
But that's sub-optimal, no? Imagine a very large buffer which was
narrowed to a small portion near EOB, then a modification made very
close to EOB but partially before BEGV, then the buffer widened. With
your method, TS will now have to re-parse almost the entire buffer,
whereas we know it needs to re-parse a very small portion of it.
- Re: How to add pseudo vector types, Eli Zaretskii, 2021/08/03
- Re: How to add pseudo vector types, Fu Yuan, 2021/08/03
- Re: How to add pseudo vector types,
Eli Zaretskii <=
- Re: How to add pseudo vector types, Fu Yuan, 2021/08/03
- Re: How to add pseudo vector types, Stefan Monnier, 2021/08/03
- Re: How to add pseudo vector types, Eli Zaretskii, 2021/08/03
- Re: How to add pseudo vector types, Yuan Fu, 2021/08/05
- Re: How to add pseudo vector types, Eli Zaretskii, 2021/08/06
- Tree-sitter api (Was: Re: How to add pseudo vector types), Fu Yuan, 2021/08/07
- Re: Tree-sitter api (Was: Re: How to add pseudo vector types), Eli Zaretskii, 2021/08/07
- Re: Tree-sitter api, Stefan Monnier, 2021/08/07
- Re: Tree-sitter api, Theodor Thornhill, 2021/08/07
- Re: Tree-sitter api, Stefan Monnier, 2021/08/07