Conversation
… in deserialization
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.
This pull request enhances the YAML deserialization logic to correctly handle folding of multiline plain and single-quoted scalars according to the YAML 1.2 specification. It introduces a new folding mechanism in the parser and adds comprehensive tests to ensure correct behavior for various multiline and quoted scalar scenarios.
Parser improvements:
Utf8YamlReader.csto fold line breaks into spaces for plain and single-quoted scalars, following YAML 1.2 folding rules. This includes a newFoldMultilineScalarmethod to handle folding and whitespace trimming, and updates to ensure single-quoted strings handle escaped quotes properly. [1] [2]Test coverage:
PrimitiveSerializationTests.csto validate multiline scalar folding for plain, single-quoted, and double-quoted strings, including handling of blank lines, escaped quotes, long lines, and error cases such as invalid tab indentation.These changes ensure the YAML parser now matches the expected YAML specification behavior for multiline scalar folding and improves robustness for edge cases.