diff options
author | bptato <nincsnevem662@gmail.com> | 2024-01-30 22:59:14 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-01-30 22:59:14 +0100 |
commit | 43f8046f8521a4a9dd836916b7ddf4c74f80d6ba (patch) | |
tree | 7703d5d99333d9aa3ee17fe0d95819c2b161102c /src | |
parent | c811ea41ded0381b63f0b6d0e5574ecd48a07638 (diff) | |
download | chawan-43f8046f8521a4a9dd836916b7ddf4c74f80d6ba.tar.gz |
toml: allow EOF in values with laxnames
Useful for clearing settings with -o
Diffstat (limited to 'src')
-rw-r--r-- | src/config/toml.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/config/toml.nim b/src/config/toml.nim index 8c9d4b4c..ce349716 100644 --- a/src/config/toml.nim +++ b/src/config/toml.nim @@ -591,6 +591,8 @@ proc consumeValue(state: var TomlParser): TomlResult = return state.err("invalid token: " & s) else: return state.err("invalid character in value: " & c) + if state.laxnames: + return ok(TomlValue(vt: VALUE_STRING, s: "")) return state.err("unexpected end of file") proc parseToml*(inputStream: Stream, filename = "<input>", laxnames = false): |