-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Description
In the buffer parser, when tracking capture group positions, the start positions incorrectly include positions from failed match attempts. This requires a workaround where start positions must be truncated to match the size of end positions.
Current Behavior
When parsing tokens with capture groups, token.get_reversed_reg_positions(start_reg_id) returns start positions that include failed match starts in addition to successful matches.
Expected Behavior
Start positions should only include positions from successful matches, matching the behavior of end positions.
Location
- File:
tests/test-buffer-parser.cpp - Lines: 146-148
- PR: feat: Support non-unique capture names (fixes #180). #193
- Comment: feat: Support non-unique capture names (fixes #180). #193 (comment)
Current Workaround
// Note: Known bug that start positions contain failed match starts as well, so
// currently it must be truncated.
actual_start_positions.resize(actual_end_positions.size());Related Issues
- feat: Handle tracking multi-valued tags for capture regex. #130 (feat: Handle tracking multi-valued tags for capture regex) - related to tag tracking issues but broader in scope
Metadata
Metadata
Assignees
Labels
No labels