Repository navigation
fix(awk): visit for-in keys in gawk's storage order - #2588
Merged
Merged
Conversation
Unsorted for (k in a) now models gawk's cint/int/str arrays, so loops print like Debian awk. All gawk cases in the Debian-oracle awk set pass. Claude-Session: https://claude.ai/code/session_01VscpEzxtqpCKx5eRMpywNj
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 233cc05 | Commit Preview URL Branch Preview URL |
Oct 07 2026, 07:21 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
for (k in a)withoutPROCINFO["sorted_in"](and with@unsorted) now visits keys in the order gawk 5.2 does. The newawk/order.rsmodels gawk's three array kinds and picks one from the first key stored, the way gawk does:Why
Before this change, unsorted loops printed numeric keys ascending and then the other keys sorted by bytes. Scripts that print
for (k in a)output, and the expected outputs written for them, follow Debian awk's order. This was the last gawk case the Debian-oracle bench failed after #2583.Before / After
Debian-oracle awk set (260 cases): 93.8% → 94.2% lenient. Every gawk case now passes; the 15 left all call
mawkby name and expect its dialect (L-AWK-004).Risk
delete, gawk's order also depends on keys that were removed, and this change does not model that. L-AWK-001 is narrowed to that case.Checklist
order::tests: hash order against a gawk golden, integer ordering, mixed keys, integer-key classification, coverage of every key)https://claude.ai/code/session_01VscpEzxtqpCKx5eRMpywNj
Generated by Claude Code