ktoml
ktoml copied to clipboard
Multiline literal strings
Multi-line literal strings are surrounded by three single quotes on each side and allow newlines. Like literal strings, there is no escaping whatsoever. A newline immediately following the opening delimiter will be trimmed. All other content between the delimiters is interpreted as-is without modification.
regex2 = '''I [dw]on't need \d{2} apples'''
lines = '''
The first newline is
trimmed in raw strings.
All other whitespace
is preserved.
'''
@akuleshov7 can I try to take a stab at this ? Don't know if you've started looking at it yet (and don't know if I can do it quickly) but I'd like to try
(I have a WIP right now, as soon as work clears up a little bit I'll try to go back to it)
Got it, removed myself
Hi there! I see that there are no updates. I almost completed this issue, MR will be soon.
Hi there! I see that there are no updates. I almost completed this issue, MR will be soon.
the only thing I have is this test :D
class MultilineStrings {
@Test
fun positiveSimpleParsing() {
val string = """
[[fruits]]
a = '''
b = 4
'''
""".trimIndent()
val parsedToml = tomlParser.parseString(string)
parsedToml.prettyPrint()
assertEquals(
"""
| - TomlFile (rootNode)
""".trimMargin(),
parsedToml.prettyStr()
)
}
}
Could you please also add such parsing test and not only decoding/encoding test
@BOOMeranGG may be take it into the nearest release? I plan it in 1-2 weeks
Ok. One question: why was #8 closed? Do we need to support multiline literal and basic strings?