all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#72691: Recursive descent in treesiter parse tree
@ 2024-08-18  4:57 Pranshu Sharma
  2024-08-18  9:24 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Pranshu Sharma @ 2024-08-18  4:57 UTC (permalink / raw)
  To: 72691

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

Hello all,

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

[-- Attachment #2: Type: text/html, Size: 932 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-31  8:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-18  4:57 bug#72691: Recursive descent in treesiter parse tree Pranshu Sharma
2024-08-18  9:24 ` Eli Zaretskii
2024-08-18 14:57   ` Pranshu Sharma
2024-08-20  3:38     ` Yuan Fu
2024-08-31  8:12       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.