diff options
author | bptato <nincsnevem662@gmail.com> | 2023-08-19 09:56:55 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-08-19 10:02:17 +0200 |
commit | 01dfb3abe8d3a282a127aafd34e55fff1ff9d2df (patch) | |
tree | 36104b6aedfe1d82636133f8da441f04afe5122b /src | |
parent | ca30c22f03870b8f8aa37939f2f3db737e6a1737 (diff) | |
download | chawan-01dfb3abe8d3a282a127aafd34e55fff1ff9d2df.tar.gz |
toml: fix quotation chars in multiline strings
Diffstat (limited to 'src')
-rw-r--r-- | src/config/toml.nim | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/config/toml.nim b/src/config/toml.nim index 66f8335f..a4e13dea 100644 --- a/src/config/toml.nim +++ b/src/config/toml.nim @@ -159,13 +159,15 @@ proc consumeString(state: var TomlParser, first: char): if c == '\n' and not multiline: return state.err("newline in string") elif c == first: - if multiline and state.has(1): - let c2 = state.peek(0) - let c3 = state.peek(1) - if c2 == first and c3 == first: - discard state.consume() - discard state.consume() - break + if multiline: + if state.has(1): + let c2 = state.peek(0) + let c3 = state.peek(1) + if c2 == first and c3 == first: + discard state.consume() + discard state.consume() + break + res &= c else: break elif first == '"' and c == '\\': |