A generic nested data structure file format, where data is formed by nested lists with both sequential data and key-value paired data.
A generic nested data structure textual format.
Data is formed by nested lists with associated key-value paired data.
Each list can have any number of elements, either sublists or text values, and any number of key-value data.
Particularly, a list containing only sequential data would be like regular lists or arrays and
a list containing only key-value data would be like maps or dictionaries.
,
and semi-colons ;
separates list nodes()
, brackets []
or braces {}
delimit a child list'
, double quotes "
and backticks `
delimit a single()
, []
, ,
, :
or ;
.'one ''quoted'' phrase'
one 'quoted' phrase
, for example. Notice that quotation marks canf'
or double"quotes"
#
starts a comment, so the rest of the line text is discarded.#
as the first character in a text value, the text must be quoted:
just after a text value marks a key-value data binding:
in a text value, the text must be quoted.It’s interesting to notice that valid JSON files are also valid Nested files,
although Nested does not enforce the same semantics for non-textual values like numbers and null
, nor
text escape sequences.
For now, there is an implementation in Lua. Lua tables
are exactly a representation of data with both sequential and key-pair values.
Install it using LuaRocks:
$ luarocks install nested
Or just copy lua/nested.lua
into your Lua path and require
it, the module has no dependencies.
There is also a Command Line Interface script for reading and reformatting nested data in the file lua/main.lua
.
When installing with LuaRocks, the CLI script is installed as the nested
command.
$ luarocks install nested-cli
LDoc based documentation for the Lua module is
available at github pages and can be generated with
the following command:
$ ldoc lua/doc -d docs