fix(lib): restrict pattern_map optimization when a wildcard step has an immediate first child
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
This commit is contained in:
parent
9d1ac21392
commit
9610a84600
2 changed files with 18 additions and 1 deletions
|
|
@ -2740,7 +2740,7 @@ TSQuery *ts_query_new(
|
|||
// there is a parent node, and capture it if necessary.
|
||||
if (step->symbol == WILDCARD_SYMBOL && step->depth == 0 && !step->field) {
|
||||
QueryStep *second_step = &self->steps.contents[start_step_index + 1];
|
||||
if (second_step->symbol != WILDCARD_SYMBOL && second_step->depth == 1) {
|
||||
if (second_step->symbol != WILDCARD_SYMBOL && second_step->depth == 1 && !second_step->is_immediate) {
|
||||
wildcard_root_alternative_index = step->alternative_index;
|
||||
start_step_index += 1;
|
||||
step = second_step;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue