Skip to content

Buffer parser: Start positions incorrectly include failed match starts #194

@coderabbitai

Description

@coderabbitai

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

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions