GNU bug report logs - #72691
Recursive descent in treesiter parse tree

Previous Next

Package: emacs;

Reported by: Pranshu Sharma <pranshusharma198 <at> gmail.com>

Date: Sun, 18 Aug 2024 07:36:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 72691 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pranshu Sharma <pranshusharma198 <at> gmail.com>,
 Yuan Fu <casouri <at> gmail.com>
Cc: 72691 <at> debbugs.gnu.org
Subject: Re: bug#72691: Recursive descent in treesiter parse tree
Date: Sun, 18 Aug 2024 12:24:26 +0300
> From: Pranshu Sharma <pranshusharma198 <at> 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.




This bug report was last modified 265 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.