Repository navigation
Use a spaced separator when adding to a single-entry inline table - #736
Open
velutinous wants to merge 1 commit into
Open
velutinous wants to merge 1 commit into
velutinous wants to merge 1 commit into
Conversation
A key added after parsing to an inline table with one entry (or none)
was written after a bare ",": setting "c" on `a = {b = 1}` gave
`a = {b = 1,c = 2}`. Tables with two or more entries already copy the
", " spacing of their explicit separators, but a one-entry table has no
separator to copy, and the comma was followed by a space only for tables
built in code.
The comma is now followed by a space unless the text after it already
starts with whitespace, so a padded table such as `{ b = 1 }` still gets
exactly one space. A dict appended to an array goes through the same
path and is now written as `{name = "John Doe", email = "..."}`.
|
✅ Human Attestation: @velutinous attested this PR at commit
Later pushes to this PR stay attested. Attestation page |
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.
A key added after parsing to an inline table with one entry (or none) was written after a bare ",": setting "c" on
a = {b = 1}gavea = {b = 1,c = 2}. Tables with two or more entries already copy the ", " spacing of their explicit separators, but a one-entry table has no separator to copy, and the comma was followed by a space only for tables built in code.The comma is now followed by a space unless the text after it already starts with whitespace, so a padded table such as
{ b = 1 }still gets exactly one space. A dict appended to an array goes through the same path and is now written as{name = "John Doe", email = "..."}.Summary
Fixes #
Duplicate Check
Agent Drafting Metadata