This PR mainly adds support for optional attributes for includes: [optional] and [once]
e.g. include [once] base.cfg allows including the same file twice, which may be useful if some base values or
structure is defined in a separate file that may be transitively included from multiple places.
By default, the parser will fail when it encounters a duplicate include, this leads to duplicate key definitions.
w.g. include [optional] file_may_not_exist.cfg enables a config to reference files that may be missing.
By default, the parser will fail when it encounters a missing file.
In addition a few housekeeping things:
tests for include statements
fail on duplicate includes
improve nested error reporting with a "backtrace"
moved the debug flags to cmake so it's easier to enabled/disable
made the critical errors a little less in your face ;-)
integrated the pegtl parser tracer in all parse calls (behind flag), and customized it with more support for nested parsing, and providing more information to make it easier to follow when working on grammar
This PR mainly adds support for optional attributes for includes:
[optional]
and[once]
include [once] base.cfg
allows including the same file twice, which may be useful if some base values or structure is defined in a separate file that may be transitively included from multiple places. By default, the parser will fail when it encounters a duplicate include, this leads to duplicate key definitions.include [optional] file_may_not_exist.cfg
enables a config to reference files that may be missing. By default, the parser will fail when it encounters a missing file.In addition a few housekeeping things: