diff options
| author | bptato <nincsnevem662@gmail.com> | 2025-04-15 20:33:02 +0200 |
|---|---|---|
| committer | bptato <nincsnevem662@gmail.com> | 2025-04-15 20:41:27 +0200 |
| commit | 95640d50d9e585e98048c394d6aa1b91a0be1d77 (patch) | |
| tree | 2cfc026dc7bfe50b32e0c689bdc5fb56d055ee42 /src | |
| parent | 1bcd869d31977b7e73faf41dc5efb9592afae965 (diff) | |
| download | chawan-95640d50d9e585e98048c394d6aa1b91a0be1d77.tar.gz | |
toml: remove broken special case, update docs
Turns out the cure was worse than the disease. Let's just make it a
backwards incompatible change, so that at least the error message is
no longer nonsensical.
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/toml.nim | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/config/toml.nim b/src/config/toml.nim index 6842d7fc..9b68f2f3 100644 --- a/src/config/toml.nim +++ b/src/config/toml.nim @@ -276,17 +276,9 @@ proc flushLine(state: var TomlParser): Err[TomlError] = table.map[keys[i]] = TomlValue(t: tvtTable, tab: node) table = node inc i - let value = node.value - if i == 0 and value.t == tvtArray and value.a.len == 0: - # old delete syntax - let s = keys.join('.') - state.arraySeen.del(s) - table.clear = true - elif keys[i] in table.map: + if table.map.hasKeyOrPut(keys[i], node.value): return state.err("re-definition of node " & keys.join('.')) - else: - table.map[keys[i]] = value - table.nodes.add(state.node) + table.nodes.add(state.node) state.node = nil inc state.line return ok() |