Skip to content

feat(rg): parse separator escapes as bytes - #1695

Merged
chaliy merged 1 commit into
mainfrom
2026-05-22-rg-batch-16
May 23, 2026
Merged

chaliy merged 1 commit into
mainfrom
2026-05-22-rg-batch-16

Conversation

@chaliy

@chaliy chaliy commented May 23, 2026

Copy link
Copy Markdown
Contributor

What

Parses rg separator escape sequences as bytes before decoding to Bashkit text output.

Why

Real rg treats \xNN in separator flags as raw bytes. The previous parser converted those bytes directly to Unicode scalar values, which diverged for high bytes and escaped UTF-8 byte sequences.

How

  • Builds separator values as bytes, then decodes with UTF-8 lossiness to match the differential harness output model.
  • Keeps existing ASCII escapes unchanged.
  • Adds byte-exact real-rg differential cases for high-byte and escaped UTF-8 separators.

Risk

  • Low / Medium
  • Affects custom rg field/context separator escape handling.

Checklist

  • Tests added or updated
  • Backward compatibility considered

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 4bd7027 Commit Preview URL May 23 2026, 12:09 AM

@chaliy
chaliy merged commit 3c71a3a into main May 23, 2026
34 checks passed
@chaliy
chaliy deleted the 2026-05-22-rg-batch-16 branch May 23, 2026 00:21
chaliy added a commit that referenced this pull request May 30, 2026
## What
Parses rg separator escape sequences as bytes before decoding to Bashkit
text output.

## Why
Real rg treats `\xNN` in separator flags as raw bytes. The previous
parser converted those bytes directly to Unicode scalar values, which
diverged for high bytes and escaped UTF-8 byte sequences.

## How
- Builds separator values as bytes, then decodes with UTF-8 lossiness to
match the differential harness output model.
- Keeps existing ASCII escapes unchanged.
- Adds byte-exact real-rg differential cases for high-byte and escaped
UTF-8 separators.

## Risk
- Low / Medium
- Affects custom rg field/context separator escape handling.

## Checklist
- [x] Tests added or updated
- [x] Backward compatibility considered
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