Parses TOML files
Author: Raphael Pinson raphael@camptoc amp.com .pinson
Toml | Parses TOML files |
Reference | https://github.com |
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 | A simple comment |
empty | An empty line |
eol | An end of line |
value entries | |
tables | |
table_gen | A generic table |
table | A table or array of tables |
lens | |
lns | The Toml lens |
A simple comment
let comment = IniFile.comment "#" "#"
An empty line
let empty = Util.empty_dos
An end of line
let eol = Util.doseol
A generic table
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 table or array of tables
let table = table_gen "table" "[" "]" | table_gen "@table" "[[" "]]"
The Toml lens
let lns = (entry | empty | comment)* . table*