- The
try_catchandtry_catch_typerules were renamed totry_catch_return_falseandtry_catch_type_return_false, respectively. - The
rewind_modevaluesactiveanddontcarehave been replaced by the single new valueoptionalwherefore code using the old values needs to be updated. - Check whether the
rewind_modeof the top-levelparse()function, which is nowoptionalby default, needs to be set to the previous value ofrequiredfor your parsing runs. - The PEGTL generated
parse_errorexceptions now contain a singlepositionobject (previously astd::vector< position >). Nested exceptions are now used to convey multiple positions during nested parsing. The headertao/pegtl/contrib/nested_exceptions.hppcontains some functions to work with nested exceptions. - The counter used to limit the nesting depth of certain rules at runtime is no longer part of all input classes. When required it needs to be added back to the input by including
tao/pegtl/contrib/input_with_depth.hppand using objects of typetao::pegtl::input_with_depth< Input >where previously inputs of typeInputwere used.
- The build system needs to be configured for C++17 or later.
- The macro
TAO_PEGTL_NAMESPACEnow defines the fully qualified namespace and was changed frompegtltotao::pegtl. When settingTAO_PEGTL_NAMESPACE, adapt as needed; in case of doubt, addtao::as prefix. - The 0-based
byte_in_linewas replaced with the 1-basedcolumn. - The control class template's
apply()andapply0()must only be visible (e.g. via SFINAE) when an action class template function with the appropriate signature exists. Seetao::pegtl::normalas example. - If you have a use-case for state's
S::success()to have an extended signature to get access to the currentapply_mode,rewind_mode, action- and control class (template), please let us know and we'll re-add this feature. - The compatibility macros starting with
TAOCPP_PEGTL_were removed, the correspondingTAO_PEGTL_-prefixed macros must be used. - The compatibility uppercase enumerators were removed, the corresponding lowercase enumerators must be used.
- The compatibility
peek_byte()member functions were removed, thepeek_uint8()member functions must be used. - The compatibility header
changes.hppwas removed, use the action-basedchange_*.hppheaders. - The parse tree nodes provide
node->type(astd::string_view) instead ofnode->name(). - The parse tree nodes provide
node->string_view()andnode->string()instead ofnode->content().
- All enumerators were changed from uppercase to lowercase.
- The enumerator
tracking_mode::IMMEDIATEwas renamed totracking_mode::eager. - The input-classes'
peek_byte()member function was renamed topeek_uint8().
Compatibility enumerators and functions are provided, they will be removed in version 3.0.0.
- The common prefix for all macros was changed from
TAOCPP_PEGTL_toTAO_PEGTL_.
Compatibility macros are provided, they will be removed in version 3.0.0.
Some of the changes for version 2.0.0 require modifications to any source using the PEGTL. The good news is that the semantics of all parsing rules and grammars is the same as for versions 1.x. Existing grammars will continue to work as before once the following list of mostly naming and namespace related changes is taken into account.
- Everything in the PEGTL is now in namespace
tao::pegtl. - The file name extensions were changed from
.hhto.hpp. - The main include file is now
<tao/pegtl.hpp>, all other include files are<tao/pegtl/*.hpp>. - The distribution of tasks between the parse functions and input classes was changed.
- The string macros have been renamed from
pegtl_(i)string_ttoTAOCPP_PEGTL_(I)STRING. - The
begin()member function of the input-classes is now calledcurrent(). - The first argument to actions'
apply()is now of typetao::pegtl::internal::action_input< ... >.
For flexibility and future compatibility it is recommended to "template over" the first argument to apply() as shown in Actions and States.
The pegtl part of the namespace can be controlled with the TAOCPP_PEGTL_NAMESPACE macro which is set in include/tao/pegtl/config.hpp if not defined previously.
Most of the other changes for version 2.0.0 extend or optimise the PEGTL without breaking compatibility. Applications integrated more tightly with the PEGTL might require additional changes.
Please contact the authors at taocpp(at)icemx.net for any further questions when updating the PEGTL.
There were many important changes leading up to version 1.0.0.
Please contact the authors at taocpp(at)icemx.net for any further questions when updating the PEGTL.
This document is part of the PEGTL.
Copyright (c) 2017-2023 Dr. Colin Hirsch and Daniel Frey
Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt