fix(bash): preserve whitespace after empty assignments - #1107
Open
denisvmedia wants to merge 1 commit into
Open
Conversation
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.
Fixes #1106.
! A=x B= commandmust leaveBempty and preservecommandas the command name. The opening-parenthesis probe consumed the separating whitespace before the scanner reachedEMPTY_VALUE. Some inputs produced a missing word. Others produced an incorrect assignment without an error flag.Preserve whitespace when
EMPTY_VALUEis valid. The existing scanner then emits its zero-width token. The change adds one condition and leaves grammar data, token identities, and parser recovery unchanged.Add shared inputs and blackbox tests:
HasErrorOrMissing().Validation used a dedicated Linux Docker container with two CPUs and an 8 GiB memory limit. No repository-wide host sweep ran.
Before the fix: 12 of 18 new cases failed.
With the fix: all 18 cases and available Bash regressions passed.
The locked C comparison passed for 16 valid inputs across three routes. It checks symbols, fields, byte/point spans, flags, child order, and deep digests.
Existing Bash fresh/incremental parity and C-reference regressions passed.
The final fix passed Bash race tests on Go 1.27.0.
Bash tests passed with
CGO_ENABLED=0on Go 1.22.0, the module's declared minimum compiler.Actionlint passed for the changed workflow.
TestBashForestRepetitionFoldDispatchskipped because its optional real-corpus fixture was absent.Reproduce the scoped checks inside a Docker container: