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: Thu, 15 Jul 2021 12:26:25 -0400



And, for tree-sitter to take the buffer’s content directly, we need to tell it to skip the gap.

AFAIR, tree-sitter allows the calling package to provide a function to
access the text, isn't that so?  If so, you could write a function
that accesses buffer text via BYTE_POS_ADDR etc., and that knows how
to skip the gap already.

Yes, that function returns a char*. But what if the gap is in the middle of the portion that tree-sitter wants to read? Alternatively, we can copy the text out and pass it to tree-sitter, but you don’t like that, IIRC.

Or we can only copy out when the portion tree-sitter wants encompasses the gap, I expect this case to be relatively rare so we won’t copy out all the time, and most of the time tree-sitter just reads from the buffer directly.

Yuan

reply via email to

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