Added Support for explicit-key and Refactored TokenStream#76
Open
HatoYuze wants to merge 16 commits intoHim188:masterfrom
Open
Added Support for explicit-key and Refactored TokenStream#76HatoYuze wants to merge 16 commits intoHim188:masterfrom
HatoYuze wants to merge 16 commits intoHim188:masterfrom
Conversation
feat: Add char serialization using Unicode code points fix: Correct serialization for chars with special characters
Also: Updated kotlinx.serialization to 1.7.0 for compatibility
rename complex-key to explicit-key
Contributor
Author
|
@Him188 ping❤️ |
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.
TokenStream Refactoring
quotedandnewLined) intoint-based bitmasks.nextToken:ignoreIndexto ignore characters at specific positions when reading tokens fromsource, while simultaneously increasingcurrentIndent.Token: ForToken.COLON,Token.MULTILINE_LIST_FLAG, and the newly addedToken.EXPLICIT_MAPPING_KEY,the next character must be a space; otherwise, it will be parsed as a string.
Additionally, the behavior for
Token.COMMAdepends onstopOnComma. If this parameter istrue, the behavior remains unchanged; otherwise, it aligns with the above logic.As a result, the original compensation for misparsed tokens has been removed.
Escape.kt)::character will only terminate if the next character is a space.currentIndentis no longer reset upon encountering a newline character. Instead,curis rolled back to the position before the newline (the responsibility of resettingcurrentIndentshould be handled by the subsequentnextTokencall).New Features
explicit-key (
complex key)Enabled the use of non-primitive elements as mapping keys. Implemented parsing and serialization for the
explicit-keyspecification (during serialization, explicit specification of whether to provide '?' is not supported; it will only appear automatically when the key is non-primitive).Requirements:
map; not supported in (de)serializers for classes.flowformat).flowformat).?and:must be at the same indentation level; otherwise, the colon will be treated as part of the nested element (inflowformat, only requires all{and}to be matched).Additionally, the following requirements from the specification have been implemented for
BlockMap:: <value>will be parsed asnull: <value>.1024characters.Changes to
YamlDecodingExceptionThe original error messages included meaningless stack traces, which could impair user judgment. Therefore, on the
jvmplatform, the corresponding stack traces have been removed.Theoretically, this PR resolves the following issues:
close #70 #66 #45 #36