Introduce comments to the config syntax

pull/45/head
rexim 5 years ago
parent ff660050ff
commit 2c338d6a9d

@ -41,7 +41,10 @@ macro parseObject(obj: typed, key, val: string) =
proc loadConfig*(filePath: string): Config =
result = defaultConfig
for line in filePath.lines:
for rawLine in filePath.lines:
let line = rawLine.strip
if line.len > 0 and line[0] == '#':
continue
let pair = line.split('=', 1)
let key = pair[0].strip
let value = pair[1].strip

Loading…
Cancel
Save