From 1d6ea51b6374b53d73769b5f4814b585ef7e9b86 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 18 Feb 2020 21:32:41 -0800 Subject: [PATCH] query: Make * operator only match named nodes --- lib/src/query.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/query.c b/lib/src/query.c index 7e13978d..4639550e 100644 --- a/lib/src/query.c +++ b/lib/src/query.c @@ -1238,7 +1238,9 @@ static inline bool ts_query_cursor__advance(TSQueryCursor *self) { // Determine if this node matches this step of the pattern, and also // if this node can have later siblings that match this step of the // pattern. - bool node_does_match = !step->symbol || step->symbol == symbol; + bool node_does_match = + step->symbol == symbol || + (!step->symbol && ts_node_is_named(node)); bool later_sibling_can_match = can_have_later_siblings; if (step->field) { if (step->field == field_id) {