From 79eaa68793fa8e7b24303dd2247e730083b34e2d Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 7 Jul 2022 18:11:52 -0700 Subject: [PATCH] Don't match nested wildcard patterns against error nodes --- lib/src/query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/query.c b/lib/src/query.c index 80a9e248..1033f1c3 100644 --- a/lib/src/query.c +++ b/lib/src/query.c @@ -3406,7 +3406,7 @@ static inline bool ts_query_cursor__advance( // pattern. bool node_does_match = false; if (step->symbol == WILDCARD_SYMBOL) { - node_does_match = is_named || !step->is_named; + node_does_match = !node_is_error && (is_named || !step->is_named); } else { node_does_match = symbol == step->symbol; }