reject array-of-tables header missing its second closing bracket#519
Open
netliomax25-code wants to merge 1 commit into
Open
reject array-of-tables header missing its second closing bracket#519netliomax25-code wants to merge 1 commit into
netliomax25-code wants to merge 1 commit into
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.
Summary
When a table header is opened with
[[for an array of tables,_parse_tableskips the first closing bracket after checking it is], but then consumes a second character as the matching close bracket without verifying it, behind a leftover# TODO: Verify close bracket. A header opened with[[and closed with a single](or with trailing junk after one], or that hits EOF) is silently accepted: inputs like[[a]b,[[a],[[a.b]xand[[a]xparse as[[a]], and round-tripping rewrites the malformed header to the valid form, so an out-of-spec document is accepted and its text changed under you. tomllib and the toml-test suite reject all of these. The fix mirrors the existing single-bracket check: confirm the second character is](raisingUnexpectedCharError, orUnexpectedEofErrorat end of input) before consuming it. Added regression tests for the missing-bracket forms.Agent Drafting Metadata