fix(lib): prevent wildcards from incorrectly marking child patterns as infallible
When a pattern appears under a wildcard parent (like "(_ (expr))"), we were incorrectly marking it as infallible. The parent_pattern_guaranteed flag only means the pattern will match after finding the right wildcard parent, not that any wildcard parent will work.
This commit is contained in:
parent
a7e6d01144
commit
5f379da544
2 changed files with 31 additions and 1 deletions
|
|
@ -3004,7 +3004,7 @@ bool ts_query__step_is_fallible(
|
|||
return (
|
||||
next_step->depth != PATTERN_DONE_MARKER &&
|
||||
next_step->depth > step->depth &&
|
||||
!next_step->parent_pattern_guaranteed
|
||||
(!next_step->parent_pattern_guaranteed || step->symbol == WILDCARD_SYMBOL)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue