Replies: 1 comment
-
Discussed in #2514 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, while working on neovim/neovim#24738, we came to think about the implementation of the predicates when applied upon a quantified match.
Take for example the following C code:
And the following query:
In the current implementation of both the CLI and the web bindings, the predicate
#eq?
would match in the case because the first captured node matches the predicate. We don't know if the current behavior was intended, and would like to make it clearer for consistency across the downstream implementors.There are other possible versions of this:
Finally, I thought that giving proper names to predicates (just like
#not-eq?
for example) and prefixing them by e.g.any
orall
could allow to make the behavior explicit (having no prefix could default to e.g. the current implementation), then the predicates would look like the following examples:any-eq?
,all-match?
, ...Pinging some people that took part in the discussion: @lewis6991 @clason @amaanq
Beta Was this translation helpful? Give feedback.
All reactions