GNU bug report logs - #74963
Ambiguous treesit named and anonymous nodes in ruby-ts-mode

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 19 Dec 2024 07:20:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Yuan Fu <casouri <at> gmail.com>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 74963 <at> debbugs.gnu.org
Subject: bug#74963: Ambiguous treesit named and anonymous nodes in ruby-ts-mode
Date: Tue, 14 Jan 2025 09:52:13 +0200
>>    (sentence
>>     ,(rx (or (and bos (or "declaration"
>>                           "enum_specifier"
>>                           "union_specifier")
>>                   eos)
>>              (or "preproc"
>>                  "statement"))))
>
> Looks good. I’ve always used rx, it has the additional benefit of being macro expanded at compile time.
>
> Also, I finally added support for ‘and’, ‘named’ and ‘anonymous’. I haven’t test it yet (sorry).

Thanks!  Does it make sense also to add predicates to define
whether the node names should be matched completely?
Then maybe add two separate predicates for strict and lax matching,
e.g. for the same thing as above:

  (sentence
   (or (strict ,(rx (or "declaration"
                        "enum_specifier"
                        "union_specifier")))
       (lax ,(rx (or "preproc"
                     "statement")))))




This bug report was last modified 138 days ago.

Previous Next


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