mirror of
https://codeberg.org/xoich/nim-scfg
synced 2026-01-15 13:41:40 +00:00
No description
| src | ||
| tests | ||
| LICENSE | ||
| README.md | ||
| scfg.nimble | ||
This scfg library for Nim tries to stay faithful to the specification.
It uses the efficient lexbuffer from nim stdlib and is implemented as non recursive top down parser.
The blocks from the original spec are named groups to avoid confusion with nim blocks.
Usage
The config is returned as a nim result
let r = loadConfig(newStringStream("""
train "Shinkansen" {
model "E5" {
max-speed 320km/h
weight 453.5t
lines-served "Tōhoku" "Hokkaido"
}
}
"""))
assert r.isOk
let config = r[]
let dir0 = config[0]