Closed TorchedSammy closed 1 year ago
I was able to reproduce this by just giving a predicate a large number of arguments. The changes in #14 were able to fix it for me, let me know if the issue persists!
seems like it still happens with the code i posted
Apparently I misinterpreted the tree sitter api when I first implemented predicates. #17 should fix that but comes with a small change that the arguments passed to query's predicates could be Node
s if they come from captures.
So your reproduction would want to change to something like:
for node, name in parser:query(queryString):with {
['any-of?'] = function(t, ...)
local t_src = t:source()
for _, match in ipairs {...} do
if t_src == match then return true end
end
return false
end,
}:capture(tree:root()) do
print(node, name)
end
yes it works now thanks
hi, i'm working on evergreen for treesitter highlighting in lite xl and while trying to add support for zig i noticed that it would just cleanly exit with no error. after that, i removed predicates that i didnt have (since i was copying them from nvim-treesitter) and it still had a problem with predicates that were stated to be builtin (like
eq?
).i did some minimal testing outside lite xl and noticed that if was any predicate at all in the query it would be an issue.
here's the code i used to check: https://safe.kashima.moe/y4wq3yrbdzxq.lua if you remove the last part that queries for function builtins it will run successfully.