README.md (275223) | README.md (279549) |
---|---|
1# LIBUCL 2 | 1# LIBUCL 2 |
3[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl) | 3[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) |
4 5**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* 6 7- [Introduction](#introduction) 8- [Basic structure](#basic-structure) 9- [Improvements to the json notation](#improvements-to-the-json-notation) 10 - [General syntax sugar](#general-syntax-sugar) 11 - [Automatic arrays creation](#automatic-arrays-creation) --- 139 unchanged lines hidden (view full) --- 151} 152``` 153 154is converted to the following object: 155 156```nginx 157section { 158 blah { | 4 5**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* 6 7- [Introduction](#introduction) 8- [Basic structure](#basic-structure) 9- [Improvements to the json notation](#improvements-to-the-json-notation) 10 - [General syntax sugar](#general-syntax-sugar) 11 - [Automatic arrays creation](#automatic-arrays-creation) --- 139 unchanged lines hidden (view full) --- 151} 152``` 153 154is converted to the following object: 155 156```nginx 157section { 158 blah { |
159 key = value; | 159 key = value; |
160 } 161 foo { | 160 } 161 foo { |
162 key = value; | 162 key = value; |
163 } 164} 165``` 166 167Plain definitions may be more complex and contain more than a single level of nested objects: 168 169```nginx 170section "blah" "foo" { 171 key = value; 172} 173``` 174 175is presented as: 176 177```nginx 178section { 179 blah { | 163 } 164} 165``` 166 167Plain definitions may be more complex and contain more than a single level of nested objects: 168 169```nginx 170section "blah" "foo" { 171 key = value; 172} 173``` 174 175is presented as: 176 177```nginx 178section { 179 blah { |
180 foo { 181 key = value; 182 } | 180 foo { 181 key = value; 182 } |
183 } 184} 185``` 186 187### Convenient numbers and booleans 188 189* Numbers can have suffixes to specify standard multipliers: 190 + `[kKmMgG]` - standard 10 base multipliers (so `1k` is translated to 1000) --- 23 unchanged lines hidden (view full) --- 214``` 215 216### Macros support 217 218UCL supports external macros both multiline and single line ones: 219```nginx 220.macro "sometext"; 221.macro { | 183 } 184} 185``` 186 187### Convenient numbers and booleans 188 189* Numbers can have suffixes to specify standard multipliers: 190 + `[kKmMgG]` - standard 10 base multipliers (so `1k` is translated to 1000) --- 23 unchanged lines hidden (view full) --- 214``` 215 216### Macros support 217 218UCL supports external macros both multiline and single line ones: 219```nginx 220.macro "sometext"; 221.macro { |
222 Some long text 223 .... | 222 Some long text 223 .... |
224}; 225``` 226 227Moreover, each macro can accept an optional list of arguments in braces. These 228arguments themselves are the UCL object that is parsed and passed to a macro as 229options: 230 231```nginx --- 138 unchanged lines hidden --- | 224}; 225``` 226 227Moreover, each macro can accept an optional list of arguments in braces. These 228arguments themselves are the UCL object that is parsed and passed to a macro as 229options: 230 231```nginx --- 138 unchanged lines hidden --- |