{{ message }}
Fix issues with queries matching a parent node with anchored children (siblings)#5603
Open
lucasmdjl wants to merge 7 commits into
Open
Fix issues with queries matching a parent node with anchored children (siblings)#5603lucasmdjl wants to merge 7 commits into
lucasmdjl wants to merge 7 commits into
Conversation
…ible step splitting
…tifier inside a parent
… with states seeking immediate match
…quantifier inside a parent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

AI Policy
I used claude.ai web interface for help with debugging and reasoning through debug logs, evaluating my approach and suggesting other directions to explore, and double-checking my code.
Description
This PR fixes three issues for queries that match parent node with anchored children (siblings).
The first issue was that the check for fallible steps was only considering nodes with children, which resulted in no state split being made for anchored siblings (node1) . (node2). This prevented the query from matching beyond the first occurrence. The fix was to also consider the case where the next step is at the same depth and must be matched immediately after.
The second issue was that with this type of queries where in addition the first anchored sibling had a quantifier, the deduplication logic for states was being overly aggressive, causing the state split on the first capture (with the parent) to be dropped in favor of the loopback state. This resulted in not being able to match beyond the first occurrence. The fix was to prevent the deduplication logic to drop a state that is not seeking for an immediate match for one that is seeking for an immediate match, because the one that is not seeking for an immediate match still could match later nodes.
The third issue was that with this type of queries where in addition the first anchored sibling had a quantifier and wasn't captured, the check for fallible steps was skipping splitting the state, because the next node was a passthrough node (and not an
is_immediateone like in the first issue). This again prevented the query from matching beyond the first occurrence. The fix was to skip the next steps in the check for fallibility while they are passthrough steps.The third fix would close issue #4688 .