Skip to content

Commit 2eede1c

Browse files
authored
fix(querypredicate): fix regex matching logic
1 parent 9552d63 commit 2eede1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/io/github/treesitter/jtreesitter/QueryPredicate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ boolean test(QueryMatch match) {
125125
if (findNodes1.isEmpty()) return !isPositive;
126126
Predicate<Node> predicate = node -> {
127127
var text = Objects.requireNonNull(node.getText());
128-
return pattern.matcher(text).hasMatch() == isPositive;
128+
return pattern.matcher(text).find() == isPositive;
129129
};
130130
if (!isAny) return findNodes1.stream().allMatch(predicate);
131131
return findNodes1.stream().anyMatch(predicate);

0 commit comments

Comments
 (0)