emacs-devel
[Top][All Lists]
Advanced

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

RE: [External] : Re: Creating a paradigm for leveraging Tree Sitter's po


From: Drew Adams
Subject: RE: [External] : Re: Creating a paradigm for leveraging Tree Sitter's power
Date: Sat, 24 Dec 2022 16:52:50 +0000

> >> I'll call this the "primitive routine".  The routine would be
> >> responsible for returning a beginning and end (in a cons cell) and it
> >> would be the routine's responsibility to make sure that the beginning
> >> and end lie after (in the forward case) or before (in the backward
> >> case) the point that is passed in.
> >
> > You mean beginning and end of (symbol | string | statement | …)?
> 
> Yes.  A “simple” routine for each concept that the language has that
> would Return the beg / end of that construct.  e.g. foo-bar-statement 
> would return the beg / end of a statement.

I guess your "concept" corresponds roughly
to what `thing-at-point's calls a THING.

Returning a cons with the "beg / end" of a
THING is what `bounds-of-thing-at-point' does.

Of course, it's based on functions such as
`forward-thing' and those named on properties
`beginning-op' and `end-op' of the THING.
(It's not based on Tree Sitter.)

If Tree Sitter were to define a `beginning-op'
and `end-op' for each "concept" (THING)...

reply via email to

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