Releases: foonathan/lexy
Releases Β· foonathan/lexy
Release 2025.05.0
Potential breaking changes
scanner-common::capture_tokenwas renamed toscanner-common::capture, and oldscanner-common::captureremoved.
Previously,capture_tokenwas a linker error anyway, but if you're callingscanner-common::captureit will no longer work for arbitrary rules and instead only likedsl::capture.lexy::parse_as_treewill add a position token to production nodes that would otherwise be empty.
That way, no production node will be empty, unless the builder API is used directly.- Change
lexy::dsl::try_()error recovery behavior:
It will now skip whitespace after the (optional) error recovery rule. - Deprecate the
lexy::parse_tree::builder::finish()overload that does not take aremaining_input. - The typo
lexy::code_point::spaing_markwas fixed tospacing_mark.
New Features
- Experimental: Add
lexy::parse_tree_inputandlexy::dsl::tnode/lexy::dsl::pnodeto support multi-pass parsing. - Add
lexy::dsl::byte.if_/set/range/asciimethods to match specific bytes. - Add an overload of
fatal_error()on scanners that allows construction of type-erased generic errors (#134). - Add
lexy::buffer::release()andlexy::buffer::adopt()to deconstruct a buffer into its components and re-assemble it later. - Add
lexy::parse_tree::node::position()and::covering_lexeme(). - Add default argument to
lexy::dsl::flag(). - Add
lexy::callback_with_state. - Pass the parse state to the tag of
lexy::dsl::opif required (#172) and tolexy::dsl::error(#211). - Enable CMake install rule for subdirectory builds (#205).
Bug fixes
- Add missing
constexprto container callbacks andlexy::as_string. - Fix infinite loop in
dsl::delimitedwhen dealing with invalid code points (#173). - Fix swallowed errors from case-folding rules (#149).
- Fix
lexy::production_namefor productions in an anonymous namespace. - Fix bugs in
dsl::scan(#133, #135, #142, #154, #209). - Fix bug with the position passed to the tag constructor of
lexy::dsl::op(#170). - Fix bug where
lexy_ext::report_errorunconditionally wrote tostderr, ignoring the output iterator. - Fix bug with missing
lexy::error_context::positioninlexy::parse_as_tree(#184). - Fix
static_assertinlexy::parse_tree(#190). - Fix bugs in
lexy::input_location::operator<(#228). - Fix bugs in examples (#183)
- Add missing
&&inlexy::bind_sink(#221). - Workaround compiler bugs and improve documentation (#128, #129, #146, #181, #197, #216, #227).
New Contributors
- @jgopel made their first contribution in #128
- @NelsonEloi made their first contribution in #129
- @nickelpro made their first contribution in #134
- @jan-kelemen made their first contribution in #146
- @shohirose made their first contribution in #181
- @MarcusVoelker made their first contribution in #182
- @klao made their first contribution in #183
- @stotiks made their first contribution in #197
- @TheServer201 made their first contribution in #227
- @Spartan322 made their first contribution in #228
Full Changelog: v2022.12.1...v2025.05.0
Release 2022.12.1
- Add constructor to
lexy::input_location. lexy::error_context::productionwill not be a transparent production.- Fix
lexy::production_info::operator==when the compiler doesn't merge string literals. - Fix SWAR matching of
dsl::ascii::printanddsl::ascii::graph. - Fix CMake target installation (#108).
New Contributors
Full Changelog: v2022.12.0...v2022.12.1
Release 2022.12.0
Headline: Unicode 15 support, ability to split a grammar into multiple translation units using lexy::dsl::subgrammar, and significant performance improvements.
Potential breaking changes
- Change [
lexy::dsl::peek_not()error recovery behavior:
it will now consume the input it matched to recover, which is more useful. - Remove
Productionparameter fromlexy::error_context.
It is replaced by a type-erasedlexy::production_info. lexy::validate,lexy::parse, andlexy::parse_as_treenow type-erase generic error tags prior to invoking the callback.- Use type-erased
lexy::production_infoinstead ofProductiontype inlexy::parse_tree.
This is technically a breaking change, as it may affect overload resolution.
New features
- Update Unicode database to Unicode 15.
- Use SWAR (SIMD within a register) techniques to optimize token parsing.
- Add
lexy::dsl::subgrammarto split a grammar into multiple translation units. - Add
lexy::dsl::flagsandlexy::dsl::flagto parse enum flags. - Add overload of
lexy::dsl::positionthat parses a rule.
This allows using it as branch conditions. - Add
lexy::dsl::effectto trigger side-effects during parsing. - Add
lexy::subexpression_productionto parse a subexpression. - Add
lexy::utf8_char_encoding. - Add
lexy::parse_tree::remaining_input()and populate it bylexy::parse_as_tree. - Add
lexy::make_buffer_from_inputfunction. - Add type-erased version of
lexy::error. - Support non-
constparse state.
Bugfixes
- Fix bug where
lexy::bindcallback does not forward rvalue arguments; they got turned into lvalues instead. - Fix bug where callback composition was not allowed if the final callback returns
void. - Fix bug where
dsl::quoted(cc.error<foo>)did not usefooas the error.
New Contributors
- @Xottab-DUTY made their first contribution in #92
Full Changelog: v2022.05.1...v2022.12.0
Release 2022.05.1
- Change
dsl::scan: it will now be invoked with the previously produced values. - Add
dsl::parse_asto ensure that a rule always produces a value (e.g. when combined with thedsl::scanchange above). - Add
lexy::lexeme_inputto support multi-pass parsing. - Turn
dsl::terminator(term)(branch)into a branch rule, as opposed to being a plain rule (#74). - Add
dsl::ignore_trailing_sep()separator. - Add
lexy::bounded<T, Max>for bounded integer parsing (#72). - Add
dsl::code_unit_idrule. - Turn
lexy::forward<void>into a sink. - Support references in
lexy::parse_resultandlexy::scan_result - Fix bug that prevented
lexy::parsewith a root production whose value isvoid. - Fix bug that caused infinite template instantiations for recursive scans.
- Fix bug that didn't skip whitespace in
lexy::scannerfor token productions.
Release 2022.05.0-beta
Initial release.