No description
Find a file
Daniele Parisi f1116d89b4 license
2023-01-27 11:59:20 +01:00
src add line and col numbers to errors 2023-01-27 11:47:18 +01:00
tests add line and col numbers to errors 2023-01-27 11:47:18 +01:00
LICENSE license 2023-01-27 11:59:20 +01:00
README.md minor 2023-01-27 11:54:31 +01:00
scfg.nimble license 2023-01-27 11:59:20 +01:00

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]