GNU bug report logs -
#62333
30.0.50; Issue with tree-sitter syntax tree during certain changes
Previous Next
Full log
Message #128 received at 62333 <at> debbugs.gnu.org (full text, mbox):
>>>>>> Again, I'm talking about using a parser library. We may need to
>>>>>> introduce a way of limiting the parser to a certain range of buffer
>>>>>> text positions, independently of narrowing.
>>>>>
>>>>> Except it's already limited by narrowing.
>>>>
>>>> Which is a fragile, semi-broken means, as we all know.
>>>
>>> What is a broken mess, is user-level narrowing. And how the downstream
>>> code can never guess the purpose the narrowing was applied for.
>>
>> Note that this is what labeled narrowings attempts to solve.
>
> Labeled narrowing cannot solve this because it does nothing to alleviate
> the problems with user-defined narrowing. So if the user narrows the
> buffer, we cannot do anything to safely widen in the general case, and
> labeled narrowing cannot help us.
>
I must be missing something, but I don't understand what you mean. If a
user has narrowed a buffer to a certain region A-B, and if we want to
limit a parser to a certain region C-D, we can do that safely with
(with-narrowing C D :label 'parser-library BODY)
which will work, independently of the A-B narrowing set by the user, and
will reset the narrowing to A-B upon return. And functions inside BODY
will have to use (without-narrowing :label 'parser-library ...) to get
access to the whole buffer.
This bug report was last modified 2 years and 77 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.