Toml

Parses TOML files

Author: Raphael Pinson raphael.nosp@m..pinson@camptoc.nosp@m.amp.com

Summary
TomlParses TOML files
Referencehttps://github.com/mojombo/toml/blob/master/README.md
LicenseThis file is licenced under the LGPL v2+, like the rest of Augeas.
Lens UsageTo be documented
Configuration filesThis lens applies to TOML files.
ExamplesThe <Test_Toml> file contains various examples and tests.
base definitions
commentA simple comment
emptyAn empty line
eolAn end of line
value entries
tables
table_genA generic table
tableA table or array of tables
lens
lnsThe Toml lens

License

This file is licenced under the LGPL v2+, like the rest of Augeas.

Lens Usage

To be documented

Configuration files

This lens applies to TOML files.

Examples

The <Test_Toml> file contains various examples and tests.

base definitions

comment

let comment = IniFile.comment "#" "#"

A simple comment

empty

let empty = Util.empty_dos

An empty line

eol

let eol = Util.doseol

An end of line

value entries

tables

table_gen

let table_gen (name:string) (lbrack:string) (rbrack:string) = let title = Util.indent . label name . Util.del_str lbrack . store /[^]\r\n.]+(\.[^]\r\n.]+)*/ . Util.del_str rbrack . eol in [ title . (entry|empty|comment)* ]

A generic table

table

let table = table_gen "table" "[" "]" | table_gen "@table" "[[" "]]"

A table or array of tables

lens

lns

let lns = (entry | empty | comment)* . table*

The Toml lens

let comment = IniFile.comment "#" "#"
A simple comment
let empty = Util.empty_dos
An empty line
let eol = Util.doseol
An end of line
let table_gen (name:string) (lbrack:string) (rbrack:string) = let title = Util.indent . label name . Util.del_str lbrack . store /[^]\r\n.]+(\.[^]\r\n.]+)*/ . Util.del_str rbrack . eol in [ title . (entry|empty|comment)* ]
A generic table
let table = table_gen "table" "[" "]" | table_gen "@table" "[[" "]]"
A table or array of tables
let lns = (entry | empty | comment)* . table*
The Toml lens
Close