Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastc-core-toml

Read-only flat-table TOML parser for fastC.

Part of the fastc-core launch set. Implementation ships in the fastC v1.0 prelude — use toml::* works out of the box.

Surface

use toml::find_int;     // (text, key, fallback) -> i64
use toml::find_bool;    // (text, key, fallback) -> bool

Both lookups are scoped to the root table. Keys inside [section] headers are skipped. Comments (# ...) are honored.

Example

use toml::find_int;
use toml::find_bool;

let cfg: raw(u8) = cstr("\
# server config\n\
port = 8080\n\
debug = true\n\
\n\
[deploy]\n\
port = 9999   # section-scoped, NOT found by root lookup\n\
");

let port: i64 = find_int(cfg, cstr("port"), cast(i64, -1));     // 8080
let debug: bool = find_bool(cfg, cstr("debug"), false);          // true
let absent: i64 = find_int(cfg, cstr("missing"), cast(i64, 42)); // 42

Out of scope (v1)

Arrays of tables, inline tables, dotted-key paths, date / time values, multi-line strings, section-scoped lookups. The 80% case is "pull a port / timeout / feature flag out of fastc.toml-shaped config" — that's what v1 covers.

Status

v0.1.0 — preview. API is final.

License

MIT

About

Read-only flat-table TOML parser for fastC. Part of the fastc-core launch set.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors