config: allow grouping config settings by key prefix.
authorKrisztian Litkey <krisztian.litkey@intel.com>
Fri, 30 May 2014 15:34:51 +0000 (18:34 +0300)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Wed, 4 Jun 2014 13:01:31 +0000 (16:01 +0300)
commit948a0be8eef795ab958afe308b64be46eaafc10b
tree2a24dd8c6aece719c236d87f70e44fe93d130902
parentf97e6767bbda21d25eaeb77f69148085c282b557
config: allow grouping config settings by key prefix.

You can now group configuration settings together with an
object-like notation. For instance, the following snippet
of configuration

    foo.blah = foobar
    foo.xyz  = zy
    foo.bar.foobar = xyzzy
    foo.bar.barfoo = yaddayadda

can be replaced with the equivalent snippet

    foo = {
        blah = foobar
        xyz  = zy
        bar = {
            foobar = xyzzy
            barfoo = yaddayadda
        }
    }

Internally both will be parsed to an identical representation.
The configuration parser is still the original primitive one.
Grouping has been bolted on top of it in a similarly primitive
manner as syntactic sugar. As a side-effect, if you make any
syntactic errors when using the grouping syntax (IOW nesting or
balancing errors), the resulting error messages probably will
not be very intuitive and in some cases might not help too much
in locating the actual error. Apologies...
src/daemon/config.c