Skip to content

lantiga/clj-toml

0.4.0-instapar…
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
doc
 
 
 
 
 
 
 
 
 
 
 
 

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 Instaparse for parsing. Instaparse does all the heavy lifting, we're just sitting pretty.

clj-toml comes with a decent collection of tests. It successfully parses the TOML hard example. Easy peasy.

Supported TOML version: v0.4.0

Usage

Work is underway towards a TOML 0.4.0-compliant release. Use the 0.3.1 release (TOML 0.1.0-compliant) in the meantime:

Leiningen:

[clj-toml "0.3.1"]

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 Instaparse) and complete.

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

  • non-homogeneous arrays
  • TOML with duplicate keys

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

License

Copyright © 2013-2015 Luca Antiga.

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

About

TOML for Clojure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published