# Toml

Parses TOML files

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

Summary

Toml | Parses TOML files
Reference | https://github.com/mojombo/toml/blob/master/README.md
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

### Reference

https://github.com/mojombo/toml/blob/master/README.md

### 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