Conversation
noweave enumerated seven filter slots (filtera..filterg) with copy-pasted if/elif ladders, a workaround for a portable /bin/sh having no arrays. Stacking enough -autodefs and -filter stages exhausted them with "ran out of filters". Accumulate filters in one newline-separated variable instead, append in O(1), and build the pipeline by joining the lines with "|" and running them through a single eval. Newline is a safe separator: a filter command carries spaces but never a newline. The append stays on one source line, routing the newline through an nl variable, so noweb's continuation-line reindentation cannot splice spaces into the list. The verbose listing restores the normal IFS before each echo so its output stays identical too. The number of filters is now unbounded. Standard output and standard error are byte-for-byte identical to the old script for the no-filter, -x, -index/-autodefs, -html/-filter, -delay, -indexfrom, quoted-filter- argument, verbose and seven-filter cases on the shipped examples; an eight-filter pipeline, which the old script refused, now runs and produces the same output as the equivalent shorter one. This is the standalone form of the change: it touches only the pipeline plumbing, so it can be merged independently of any filter. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HsqKrvJ5u3A589XGjj9doX
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.
Summary
noweaveenumerated seven filter slots (filtera..filterg) with copy-pasted if/elif ladders, a workaround for a portable/bin/shhaving no arrays. Stacking enough-autodefsand-filterstages exhausted them with "ran out of filters".This accumulates filters in one newline-separated variable, appends in O(1), and builds the pipeline by joining the lines with
|and running them through a singleeval. Newline is a safe separator: a filter command carries spaces but never a newline. The number of filters is now unbounded. Only the pipeline plumbing insrc/shell/noweave.nw(and the tanglednoweave) changes, so this is independent of any filter.Test plan
-x,-index -autodefs c,-html -filter l2h,-delay -filter btdefn,-filter 'elide foo:*'(quoted argument with a glob),-indexfrom,-v, and a seven-filter pipelinenotangle.1unchanged (no man-page chunk touched)🤖 Generated with Claude Code
https://claude.ai/code/session_01HsqKrvJ5u3A589XGjj9doX