Skip to content

Location byte position#2928

Draft
soutaro wants to merge 3 commits intomasterfrom
location-byte-position
Draft

Location byte position#2928
soutaro wants to merge 3 commits intomasterfrom
location-byte-position

Conversation

@soutaro
Copy link
Copy Markdown
Member

@soutaro soutaro commented Apr 9, 2026

No description provided.

soutaro and others added 3 commits April 9, 2026 10:26
Simplify rbs_loc_range struct from 4 fields (start_char, end_char,
start_byte, end_byte) back to 2 fields (start, end), now representing
byte positions instead of character positions.

Update ast_translation template to pass start_byte/end_byte from
rbs_location_range, and remove rbs_new_location3 in favor of
rbs_new_location2 which now accepts byte positions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Buffer:
- Change ranges to use bytesize instead of char size
- Use byteslice for lines and sub_buffer
- Switch Prism integration from start_character_offset to start_offset

Location:
- Add start_byte/end_byte as primary byte position methods
- Add start_char/end_char for character positions (computed from bytes)
- Add start_byte_column/end_byte_column and start_char_column/end_char_column
- Deprecate start_pos/end_pos in favor of start_char/start_byte
- Deprecate start_column/end_column in favor of start_byte_column/start_char_column
- Use byteslice for source extraction

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rewriter: use start_byte/end_byte, start_byte_column, bytesplice
- Errors: use start_byte_column/end_byte_column for marker alignment
- Writer: use start_byte_column for indentation
- Locator: add byte_column/char_column keyword arguments to find/find2,
  deprecate column keyword, add char_column_to_byte_column helper
- CommentBlock, LocationHelper: use Prism start_offset (byte) instead
  of start_character_offset (char)
- ParserAux, Declarations: use start_byte/end_byte
- Update test expectation for byte-based column values

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant