before this change, the ceph.conf parser was implemented using a
hand-written state machine. which works fine. but it's hard to
understand and hence difficult to maintain.
in this change, it's rewritten using boost::spirit. which well, is also
a state machine under the hood, but the declarative pattern matching
rules help the human readers to understand the machinary.
before this change, the state machine is able to skip the lines with
invalid syntax and spit a warning message for each of them. after this
change, the parser will just bail out when it fails to match the rules.
and the line continuation marker, i.e., "\" is simply skipped, so it's
allowed to have nothing after the backslash in the value of key-value
pair.
changes are listed as following:
* invalid UTF-8 key/value is now treated as an error
* backslash at the very end is now allowed
* repeated settings are tolerated, and no warnings will be printed.
the last one wins. before this change, we will print out warning
messages at seeing lines with duplicated keys.
* malformed section header is now an error
* a setting line which does not parse is now an error
* unmatched quotes in setting value is now an error
* "\" following an empty line is allowed now.
* the format of error message is changed, so the cli test is updated
accordingly.
* [global] section is not added by default. unless there is a single
line in the conf file. this is only for the convenience of testing.