TOML module for Guile
Go to file
hylo 44992dd120 docs: extend readme 2022-12-30 17:53:13 +01:00
toml feat: inline-tables (wip) 2022-12-30 17:53:13 +01:00
README.org docs: extend readme 2022-12-30 17:53:13 +01:00
decoder.scm feat: add decoder 2022-12-30 17:53:13 +01:00
ex-long.toml feat: some displaying of parsed toml 2022-12-30 17:53:12 +01:00
ex.toml feat: some displaying of parsed toml 2022-12-30 17:53:12 +01:00
spec-example-1-compact.json dev: some examples from the suite 2022-12-30 17:53:12 +01:00
spec-example-1-compact.toml dev: some examples from the suite 2022-12-30 17:53:12 +01:00
test-decoder.scm fix: all toml-tests passing! 2022-12-30 17:53:13 +01:00
toml.abnf feat: convert abnf to peg manually WIP 2022-12-30 17:53:12 +01:00
toml.peg feat: convert abnf to peg manually WIP 2022-12-30 17:53:12 +01:00
toml.scm fix: flatten tree before recursing 2022-12-30 17:53:13 +01:00

README.org

Readme

guile-toml

Installation

For now: add this folder to GUILE_LOAD_PATH

Usage

When parsing and building TOML documents, guile-toml follows guile-json as close as possible. TOML types correspon to Guile types according to the following table:

TOML Guile
string string
key-value pair alist
array vector
integer/float real
true #t
false #f
datetime SRFI-19 date [1]
nan +nan.0
{+-}inf {+-}inf.0

To start using guile-toml: (use-modules (toml))

[1]: TOML's time-local is parsed same as a datetime-local on the date of 1970-01-01.

Reading TOML documents

  • (toml->scm str) Reads a TOML document from the given string.

Building TOML documents

  • (scm->toml native #:optional port) Not implemented yet.

Examples

> (toml->scm "[a]\n b.c = \"hi world\"")
(("a" ("b" ("c" . "hi world"))))