Repository navigation
Conversation
Produces a permuted index: one row per keyword occurrence with the surrounding context, laid out so every keyword lands at the same column. The measured layout is the tail right-justified in line_width / 2, then the gap, then the keyword, then one space and the head. The word is a run of letters by default, not letters and digits, which is what GNU does: '42nd' yields the keyword nd with 42 left in the context. Verification was by cross-compiling for Linux and running under WSL, since V emits Linux C from Windows but cannot link it. Three of the behaviours were wrong on the first attempt and the differential caught all three: the keyword was padded, which shifted the head one column right on rows with a short keyword; the head was truncated to the keyword width, which cut 'beta gamma' to 'beta '; and io.read_all stopped early on this platform, which produced a single truncated row instead of the whole index. Two known gaps, documented rather than faked. Truncation of a tail or head that does not fit the line width is not implemented: the marker is emitted but the column it lands in does not match GNU, and I did not decode the rule. And -r, -A, -t, -M, and the -o/-i/-b file filters parse but have no effect.
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.
ptxproduces a permuted index: one row per keyword occurrence with the surrounding context, laid out so every keyword lands at the same column.The measured layout is the tail right-justified in
line_width / 2, then the gap, then the keyword, then one space and the head.The word is a run of letters by default, not letters and digits — which is what GNU does:
42ndyields the keywordndwith42left in the context. My first version included digits, and the differential against GNU caught it.Verification was by cross-compiling for Linux and running under WSL, since V emits Linux C from Windows but cannot link it.
Three behaviours were wrong on the first attempt and the differential caught all three:
beta gammatobetaio.read_allstopped early on this platform, producing a single truncated row instead of the whole indexTwo known gaps, documented rather than faked:
ptxearlier in the session, and it is still unresolved.-r,-A,-t,-Mand the-o/-i/-bfile filters parse but have no effect.6 of 10 differential cases match GNU exactly (default, four width/gap geometries,
-f,-W, missing-file rc). The 3 truncation cases do not.