Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The parser and execution changes are consistent, regression tests cover the new behavior, and no blocking issues remain.
No open issues 🎉
What changed in this PR
Adds GNU-compatible support for combining a numeric occurrence with sed’s g substitution flag.
Changes:
- Tracks global replacement separately from the occurrence number.
- Replaces the selected match and every later match when combined.
- Tests both flag orders and preserves duplicate-flag rejection.
| File | Description |
|---|---|
| tests/by-util/test_sed.rs | Adds combined-flag and capture replacement tests. |
| src/sed/processor.rs | Applies global replacement from the selected occurrence. |
| src/sed/compiler.rs | Parses numeric and global flags independently; updates tests. |
| src/sed/command.rs | Adds separate global substitution state. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #610 +/- ##
=======================================
Coverage 95.10% 95.10%
=======================================
Files 14 14
Lines 7490 7499 +9
Branches 443 443
=======================================
+ Hits 7123 7132 +9
Misses 366 366
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
d1a8efd to
2031175
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
2031175 to
5e2821e
Compare
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
s/x/y/2g(replace the 2nd match and every later one) ands/x/y/g2are valid in GNU sed but were rejected with "multiple 'g' or numeric flags in substitute command", and unit tests asserted that.gis now tracked separately from the occurrence number. Repeating either one is still an error.