diff options
author | bptato <nincsnevem662@gmail.com> | 2023-12-15 20:13:49 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-12-15 20:13:49 +0100 |
commit | 089d974b245734042b0a01a28b1cca74de765b3b (patch) | |
tree | a4e4bcff62e0800b6092480e63545f15dfbc1d14 /src/config | |
parent | b8cb40fd46e1d41925198ff171b9fbf8362bc924 (diff) | |
download | chawan-089d974b245734042b0a01a28b1cca74de765b3b.tar.gz |
config/toml: fix consumeComment overriding nodes
We must first check if there is really no node to attach the comment to...
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/toml.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/config/toml.nim b/src/config/toml.nim index 9932cc83..4440dff4 100644 --- a/src/config/toml.nim +++ b/src/config/toml.nim @@ -298,7 +298,8 @@ proc flushLine(state: var TomlParser): Err[TomlError] = return ok() proc consumeComment(state: var TomlParser) = - state.node = TomlNode() + if state.node == nil: + state.node = TomlNode() while state.has(): let c = state.consume() if c == '\n': |