/clj-toml

TOML for Clojure

Primary LanguageClojure

clj-toml

clj-toml is TOML for Clojure. TOML is Tom's Obvious, Minimal Language.

TOML is like INI, only better (Tom Preston-Werner)

clj-toml uses Kern for parsing. Kern does all the heavy lifting, we're just sitting pretty.

clj-toml comes with a decent collection of tests.

Supported TOML version: 00f11b019406531c8c7989846b1c1a54e9b8d8bb.

Usage

Leiningen:

[clj-toml "0.2.0"]

Test:

lein test

Use:

(use 'clj-toml.core)

(parse-string "
title = \"TOML\"
[Foo]
bar=[1,2,3]")
;; {"title" "TOML" "foo" {"bar" [1 2 3]}}

TODO

The parser is pretty solid (thanks to Kern) and complete.

In a way it implements a superset of TOML, since it successfully parses

  • non-homogeneous arrays
  • TOML with duplicate keys
  • multiline strings

As the TOML specification stabilizes, we'll raise errors according to specification.

License

Copyright © 2013 Luca Antiga.

Distributed under the Eclipse Public License, the same as Clojure.