diff options
author | bptato <nincsnevem662@gmail.com> | 2023-09-25 02:00:39 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-09-25 02:00:39 +0200 |
commit | da3f78eb9333b7076591ca4088b7f26afc7852ef (patch) | |
tree | 03d2c8e1275e68473e3d76f2535e1a6323d07e63 | |
parent | 05429d959e48d50d49b60088c712d7495ecf416f (diff) | |
download | chawan-da3f78eb9333b7076591ca4088b7f26afc7852ef.tar.gz |
toml: fix bug in multiline string parsing
-rw-r--r-- | src/config/toml.nim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config/toml.nim b/src/config/toml.nim index 703d7ae5..b26fb553 100644 --- a/src/config/toml.nim +++ b/src/config/toml.nim @@ -147,6 +147,9 @@ proc consume(state: var TomlParser): char = result = state.buf[state.at] inc state.at +proc seek(state: var TomlParser, n: int) = + state.at += n + proc reconsume(state: var TomlParser) = dec state.at @@ -188,11 +191,13 @@ proc consumeString(state: var TomlParser, first: char): let s = state.peek(0, 1) if s == "\"\"": multiline = true + state.seek(2) elif first == '\'': if state.has(1): let s = state.peek(0, 1) if s == "''": multiline = true + state.seek(2) if multiline: let c = state.peek(0) |