Repository navigation
Allow whitespace between = and the value in env-spec parser - #1309
Merged
theoephraim merged 2 commits intoNov 17, 2026
Merged
theoephraim merged 2 commits into
theoephraim merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: Reviewed the parser whitespace fix and regression coverage; all 301 parser tests passed.
- Value parsing: Spaces and tabs after
=now allow quoted strings, multiline strings, function calls, arrays, and objects to parse consistently. - Regression coverage: Tests cover empty values, comments, malformed quotes, and descriptions following commented-out structured values.
- Release entry: Includes a patch release entry for
@env-spec/parser.
gpt-6.1-sol | 𝕏
Member
|
Thanks for this! Will have it merged shortly. |
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: Reviewed the additions since f32e741; all 317 parser tests passed.
- Expanded whitespace coverage: Added cases for mixed whitespace, scalar types, trailing text, spaced assignments, and
export. - Verified reference resolution: Added spaced-assignment tests for unquoted and double-quoted expansion, plus single-quoted literals.
- Removed stale commentary: Deleted the grammar comment without changing parser behavior.
gpt-6.1-sol | 𝕏
commit: |
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 #1304
A= "x"andA = "x"failed to parse withExpected "#", "\n", or [ \t] but '"' found, whileA="x"andA = xworked. Values likeA = fn(1),A = [a, b]andA = { k=v }parsed, but as plain strings instead of a function call or literal.The
ConfigItemrule had no whitespace match after=. The only value rule that accepted leading whitespace wasunquotedString, which then refused a value starting with a quote, and the function, array, object and quoted rules could not start on a space.The fix adds
_after"="inConfigItem. Unquoted values resolve the same as before, since they were already trimmed.VAL=andVAL= # commentstill have no value, and an unclosed quote after a space (VAL= "not ok) still throws. A side effect: commented-out items like# A = "x"in a description block no longer cut off the description lines after them, matching# A="x".Tests in
values.test.tscover quoted, multi-line, function call, array and object values after whitespace, plus the no-value and unclosed-quote cases. A test ingeneral.test.tscovers the commented-out description case. The new value tests fail without the grammar change.