mirror of
https://github.com/tsoding/boomer
synced 2024-11-16 12:12:47 +00:00
Introduce comments to the config syntax
This commit is contained in:
parent
ff660050ff
commit
2c338d6a9d
@ -41,7 +41,10 @@ macro parseObject(obj: typed, key, val: string) =
|
|||||||
|
|
||||||
proc loadConfig*(filePath: string): Config =
|
proc loadConfig*(filePath: string): Config =
|
||||||
result = defaultConfig
|
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 pair = line.split('=', 1)
|
||||||
let key = pair[0].strip
|
let key = pair[0].strip
|
||||||
let value = pair[1].strip
|
let value = pair[1].strip
|
||||||
|
Loading…
Reference in New Issue
Block a user