~~~json
"key": "value"
~~~
+
is equal to:
+
~~~json
{"key": "value"}
~~~
key = value;
}
~~~
+
is equal to:
+
~~~json
{
"key": "value",
"key2": "value",
}
~~~
+
### Automatic arrays creation
* Non-unique keys in an object are allowed and are automatically converted to the arrays internally:
"key": "value2"
}
~~~
+
is converted to:
+
~~~json
{
"key": ["value1", "value2"]
### Named keys hierarchy
-UCL accepts named keys and organize them into objects hierarchy internally. Here is an example of this process:
+UCL accepts named keys and organise them into objects hierarchy internally. Here is an example of this process:
+
~~~nginx
section "blah" {
key = value;
* multiline: `/* ... */`
Multiline comments may be nested:
+
~~~c
# Sample single line comment
/*
### Macros support
UCL supports external macros both multiline and single line ones:
+
~~~nginx
.macro "sometext";
.macro {
### Multiline strings
UCL can handle multiline strings as well as single line ones. It uses shell/perl like notation for such objects:
+
~~~
key = <<EOD
some text
Are UCL parser and emitter fast enough? Well, there are some numbers.
I got a 19Mb file that consist of ~700 thousands lines of json (obtained via
-http://www.json-generator.com/). Then I checked jansson library that performs json
+<http://www.json-generator.com/>). Then I checked jansson library that performs json
parsing and emitting and compared it with UCL. Here are results:
~~~