aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config/toml.nim12
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()