Repository navigation
fix(decode): three decoder cases that diverged from the spec - #355
Merged
Merged
Conversation
"a" : 1 and a root string whose only colon is quoted
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.
Three decoder cases where the reference diverged from the spec:
"a" : 1threw "Missing colon after key". Key tokens are trimmed like value tokens (§12), so spaces may separate a quoted key from its colon, as they already could for unquoted keys.hello "a:b"threw the same error, because root-form discovery looked for any colon instead of an unquoted one. It now decodes to the stringhello "a:b", which the ports already return.[2]: 1,2thenjunk) was dropped. A scalar line outside root primitive position errors in both modes (§5.2); other trailing lines are still skipped.The first and third cases are fixtures in toon-format/spec#65 and pass with it linked locally; the second follows in spec 4.2. They reach this repo with the spec releases, so this PR adds no hand-written tests.