You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a TOML v1.0.0 parser library, with dates supporting nanosecond
precision. It passes all tests in toml-test v1.3.0.
Click the "TOML Compliance" badge for logs of toml-test.
This code is a fork of Greg Hendershott's TOML parser.
Unlike that repository, this version is available on pkgs.racket-lang.org
and includes support for generating TOML.
Installation
raco pkg install --auto toml
Usage
(require toml)
(parse-toml s) ;; where `s` is a `string?`
[another-table]
key = 10
[table]
key = 5
[[table.array]]
a = 1
b = 2
[[table.array]]
a = 2
b = 4
Goals
Remain current with the most recent TOML release version.
Provide useful error messages with positions (line:col:ofs). Do so
for both syntax errors and semantic errors (such as table
conflicts).
Return a Racket hasheq that satisfies the json library's
jsexpr? predicate, so that you can run it through jsexpr->string
to produce a JSON string.
Caveat: Any TOML datetime values are date structs, which won't
satisfy jsexpr?. Originally I parsed these to a
current-seconds-style integer value. But toml-tests needs things
to be tagged with types, so that's why I had to switch. I should
probably provide a conversion function to turn any such instances
back into a datetime string so that it can be passed to
jsexpr->string.