From: Eli Zaretskii <eliz@gnu.org>
To: Pranshu Sharma <pranshusharma198@gmail.com>, Yuan Fu <casouri@gmail.com>
Cc: 72691@debbugs.gnu.org
Subject: bug#72691: Recursive descent in treesiter parse tree
Date: Sun, 18 Aug 2024 12:24:26 +0300 [thread overview]
Message-ID: <86y14uyyid.fsf@gnu.org> (raw)
In-Reply-To: <CACKBRFnTb_x6cW=zYVe0vf4CzNrnHgnizbLu3uzm0N5McUdo1g@mail.gmail.com> (message from Pranshu Sharma on Sun, 18 Aug 2024 14:57:10 +1000)
> From: Pranshu Sharma <pranshusharma198@gmail.com>
> Date: Sun, 18 Aug 2024 14:57:10 +1000
>
> I am trying to write a major mode in which all instances of a node in another matched node. For this, recursion
> is needed, and for that it is necessary to store a match in a variable:
> Say I want to highlight all instances of (x) that are inside y in the following parse tree, where bolded means I
> want to match:
> (x) in (q (y (x) (l (x) (l (x) (p))) (x))
>
> "(y) @test
> @test . (_) @font-lock-variable-name-face"
> "(y) @test
> (@test . (_) @font-lock-variable-name-face)"
> "(y) @test
> (test . (_) @font-lock-variable-name-face)"
>
> All of the above fail, which leads me to think that @test stores the text instead of the tree. In this case, how
> would I recursively match all instances of
Adding Yuan.
next prev parent reply other threads:[~2024-08-18 9:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-18 4:57 bug#72691: Recursive descent in treesiter parse tree Pranshu Sharma
2024-08-18 9:24 ` Eli Zaretskii [this message]
2024-08-18 14:57 ` Pranshu Sharma
2024-08-20 3:38 ` Yuan Fu
2024-08-31 8:12 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86y14uyyid.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=72691@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=pranshusharma198@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).