euclidianAce / ltreesitter

Standalone tree sitter bindings for the Lua language
MIT License
85 stars 4 forks source link

Scoping of predicates #18

Closed xcb-xwii closed 1 year ago

xcb-xwii commented 1 year ago

The when a predicate is defined, it is applied globally. Take the following query:

((item) @a (#eq? @a @a))
(thing) @b

One would expect that the predicate only applies to the pattern it is declared in, but it would instead be executed for all other patterns within the query. In the example provided, @a would be matched as per normal, while the pattern @b would not be matched at all.