github taocpp/PEGTL 4.0.0
PEGTL 4.0.0

one month ago
  • Even more templates, in even more places, templates everywhere!
  • Use the migration guide when updating.
  • Infrastructure
    • Switched to Boost Software License, Version 1.0.
    • Makefile generates binaries in build/bin/ instead of build/src/.
    • The pegtl sub-directory in src/example and src/test was removed.
    • Makefile generates dependencies in build/dep/ instead of build/src/.
    • Added pkg-config metadata and installation support.
    • All headers in include/tao/pegtl/contrib/ were moved to extra/, example/, deprecated/ or include/tao/pegtl/.
    • Not all headers in include/tao/pegtl/ are included by <tao/pegtl.hpp>.
    • Moved the string-literal macros to the new public header pegtl_string.hpp.
    • All stream parsing headers were moved to stream/.
    • All Unicode (incl. ICU) rules were moved to unicode/.
    • All binary rules (incl. enums) were moved to binary/.
    • All actions beyond nothing are now in action/.
    • All controls beyond normal are now in control/.
    • The debug facilities are now in debug/.
    • The example grammars are now all collected in example/.
    • There are new example grammars including some moved from src/example/.
    • Extra, experimental and deprecated headers are now in extra/ and deprecated/.
  • Exceptions
    • Changed parse_error to contain only one position.
    • Changed parse_error to be templated over the position type.
    • Added parse_error_base as non-templated base class of parse_error.
    • Changed to nested exceptions for nested parsing errors.
    • Added control function to throw nested exceptions.
    • Changed parse_nested() to throw a nested exception instead of adding a position to the current one when exceptions are enabled.
    • Changed pegtl.hpp to only include parse_error.hpp, parse_error_base.hpp and parse_nested.hpp when exceptions are enabled.
    • Added functions to visit and flatten nested exceptions.
  • Inputs
    • Standardized on line - column - count order.
    • Replaced the monolithic position class with the new position classes.
    • The input classes have been heavily refactored.
    • Replaced memory_input and string_input with view_input, copy_input, text_view_input and text_copy_input.
    • Replaced istream_input, cstream_input and buffer_input with the new stream parsing inputs.
    • Added new minimal non-owning base_input.
    • Added new input adapter input_with_offset.
    • Most input classes can use any type instead of being hardwired to char.
    • The end-of-line handling has been heavily refactored and extended.
    • Choice of statically, dynamically or user allocated buffer inputs.
    • Everything related to stream parsing is now in stream/.
    • Nothing related to stream parsing is included with <tao/pegtl.hpp>.
    • Moved action_input from internal to the main PEGTL namespace.
    • Removed action_t type alias from all input classes in favor of using action_input.
    • Removed the tracking_mode as enum and input template parameter.
    • Eliminated all unaligned memory access (unless compiler generated).
  • Rule Changes
    • All variants of the rules ione, one, not_one and ranges now require at least one template parameter.
    • The new rules not_ione and not_ranges have the same non-empty pack requirement.
    • Added Unicode rules that adapt to the input's data size.
    • Added special end-of-line rules in multiple places.
    • Added new atomic rule function.
    • Added new atomic rule restart.
    • Added new ASCII rule bdigit.
    • Added new ASCII rule cntrl.
    • Added new ASCII rule cr.
    • Added new ASCII rule cr_lf.
    • Added new ASCII rule cr_crlf.
    • Added new ASCII rule cr_lf_crlf.
    • Added new ASCII rule crlf.
    • Added new ASCII rule esc.
    • Added new ASCII rule ff.
    • Added new ASCII rule graph.
    • Added new ASCII rule ht.
    • Added new ASCII rule ione.
    • Added new ASCII rule lf.
    • Added new ASCII rule lf_crlf.
    • Added new ASCII rule not_ione.
    • Added new ASCII rule punct.
    • Added new ASCII rule sp.
    • Added new ASCII rule vt.
    • Renamed ASCII rule seven to any7.
    • Added new ASCII rule many7.
    • Added new ASCII rule not_ione7.
    • Added new ASCII rule not_one7.
    • Added new ASCII rule not_range7.
    • Added new Unicode rule cr.
    • Added new Unicode rule cr_lf.
    • Added new Unicode rule cr_crlf.
    • Added new Unicode rule cr_lf_crlf.
    • Added new Unicode rule crlf.
    • Added new Unicode rule lf.
    • Added new Unicode rule lf_crlf.
    • Added new Unicode rule ls.
    • Added new Unicode rule nel.
    • Added new Unicode rule ps.
    • Added new Unicode rule eol1.
    • Added new Unicode rule eolu.
    • Added dedicated end-of-line rules for end-of-line scanning.
    • Added dedicated end-of-line rules for lazy end-of-line mode.
    • Added new atomic rule consume.
    • Added new atomic rule everything.
    • Added new rule source.
    • Added new generic rule invert.
    • Added new convenience rule partial.
    • Added new convenience rule separated (replaces separated_seq from contrib).
    • Added new convenience rule separated_pad.
    • Added new convenience rule star_partial.
    • Added new convenience rule strict.
    • Added new convenience rule star_strict.
    • Added new convenience rule unordered.
    • Added new convenience rule unordered_partial.
    • Added rule try_catch_any_return_false.
    • Renamed rule try_catch to try_catch_return_false.
    • Added rule try_catch_std_return_false.
    • Renamed rule try_catch_type to try_catch_type_return_false.
    • Added rule raise_message and macro TAO_PEGTL_RAISE_MESSAGE.
    • Added rule try_catch_any_raise_nested.
    • Added rule try_catch_raise_nested.
    • Added rule try_catch_std_raise_nested.
    • Added rule try_catch_type_raise_nested.
    • Added rules for matching signed integers mirroring the existing ones for unsigned integers.
    • Added not_ranges variants to the ASCII, Unicode, binary and member rules.
    • Optimized utf8::string by expanding char32_t code points to UTF-8 sequences at compile time.
    • Refactored the implementation of ione, one, range, ranges, not_ione, not_one, not_range, not_ranges which changes their rule_t.
    • Added new rules for enum types to the binary rules.
    • Added new rules that operate on object members.
    • Moved discard and require to the stream parsing facilities.
    • Added new stream parsing rule is_stream.
    • Added new stream parsing rule prefetch.
  • Added new customization point for error messages.
  • Added optional source line output for the tracer.
  • Other
    • Added new control apply_typed_state.
    • Added new action add_guard.
    • Added new action change_rule.
    • Added new action match_typed_state.
    • Added new control remove_first_states.
    • Added extra/dispatch.hpp and extra/record.hpp.
    • Moved raw_string to extra/raw_string.hpp.
    • Added extra/unescape.hpp.
    • Refactored the Control adapter interface.
    • Refactored type_list_contains interface.
    • Routed rewind-guard creation through the Control class.
    • Renamed apply_mode::action to apply_mode::enabled.
    • Renamed apply_mode::nothing to apply_mode::disabled.
    • Removed random_order example, moved to core library as unordered and unordered_partial.
    • Added new charconv rules and actions in extra/charconv.hpp.
    • Renamed limit_depth functionality to check_depth.
    • Renamed check_bytes functionality to check_consume.
    • Renamed limit_bytes functionality to limit_consume.
    • Moved depth counter to adapter class input_with_depth.
    • Changed default top-level rewind_mode to optional.
    • Merged rewind_mode values dontcare and active into new value optional.
    • Renamed end_of_line() input member function to end_of_line_or_file().
    • Renamed variadic template to_string functionality to type_to_string.
    • Added type_to_string_view function that mirrors type_to_string.
    • Renamed buffer/incremental parsing to stream parsing.
    • Changed change_state to detect absence of success().
    • Changed change_action_and_state to detect absence of success().
  • Cleanup
    • Removed rule forty_two, we apologize for any inconvenience.
    • Removed rule bytes; use consume or one of the type-specific many rules.
    • Removed support for boost::filesystem and std::experimental::filesystem.
    • Removed support for building an amalgamated header.
    • Removed support for Visual Studio 2017.
    • Removed support for GCC 7 and GCC 8.
    • Removed contrib/peg.hpp and contrib/predicates.hpp.
  • The following headers have been deprecated
    • alphabet.hpp
    • if_then.hpp
    • integer.hpp (more or less replaced by extra/charconv.hpp).
    • rep_one_min_max.hpp
    • rep_string.hpp
    • unescape.hpp (replaced by example/escaped.hpp and extra/unescape.hpp).

Don't miss a new PEGTL release

NewReleases is sending notifications on new releases.