scfg

Simple configuration file format (scfg) parser

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.1.0
License CC-BY-SA 4.0
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Authors

  • Daniele Parisi

Installation

nimble install scfg
choosenim install scfg
git clone https://codeberg.org/xoich/nim-scfg

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
scfg - - - - - - -

Dependencies

Package Version Optional
nim >= 1.6.10 No

Source

Repository https://codeberg.org/xoich/nim-scfg
Homepage https://codeberg.org/xoich/nim-scfg
Registry Source nimble_official

README

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]