Him188 / yamlkt

Multiplatform YAML parser & serializer for kotlinx.serialization written in pure Kotlin
Apache License 2.0
132 stars 14 forks source link

First Pass at Multiline Strings #43

Closed floralvikings closed 2 years ago

floralvikings commented 2 years ago

My attempt at implementing multi-line strings

This is still in a fairly rough state:

However, if this approach is acceptable, I can add support and an equivalent set of tests for "literal" (using |) strings as well.

Please let me know if there are test cases I'm missing! Multiline strings in YAML are way more complicated than I initially realized so I'm sure there's something I haven't thought of.

floralvikings commented 2 years ago

I went ahead and added tests and support for literal style strings; even if the implementation isn't up to snuff, the tests should still be useful

floralvikings commented 2 years ago

@Him188 I've updated the PR in 7f017cf, I've extracted some duplicate code into functions where possible and left comments detailing the differences between the functions that couldn't be easily combined