lexy_example: /mnt/work/git/notes.txt/libraries/lexy/build/_deps/lexy-src/include/lexy/_detail/lazy_init.hpp:145: constexpr const T& lexy::_detail::lazy_init<T>::operator*() const & [with T = long unsigned int]: Assertion `*this' failed.
String, create 123 is parsed as expected, but the result of parsing the other one creat a is strange, it says it successful but it doesn't have a value. I would expect that it reports that the second string wasn't parsed.
If i remove dsl::ascii::case_folding from kw_create then the second string isn't parsed and the error is reported.
EDIT: I've debugged this problem further figured the following. This is caused by overloads of on method in class event_handler:
When parsing a case folding rule, the real Reader gets wrapped into a case_folding one and it doesn't match the Reader template parameter anymore, so the template overload gets called which doesn't do anything. This is the instantiated method from gdb: lexy::_vh<lexy::_prc>::event_handler::on<lexy::parse_events::error, lexy::error<lexy::_acfr<lexy::_prc>, lexy::expected_literal> >
If an error occurs during parsing with case folding the error is discarded and the return value from validate and parse is incorrect.
Example of grammar on playground: https://lexy.foonathan.net/playground/?id=fccxs48G3&mode=trace
The output of this program is:
Afterwards it crashes on the following assertion:
String,
create 123
is parsed as expected, but the result of parsing the other onecreat a
is strange, it says it successful but it doesn't have a value. I would expect that it reports that the second string wasn't parsed.If i remove
dsl::ascii::case_folding
fromkw_create
then the second string isn't parsed and the error is reported.EDIT: I've debugged this problem further figured the following. This is caused by overloads of
on
method in classevent_handler
:When parsing a case folding rule, the real Reader gets wrapped into a case_folding one and it doesn't match the
Reader
template parameter anymore, so the template overload gets called which doesn't do anything. This is the instantiated method from gdb:lexy::_vh<lexy::_prc>::event_handler::on<lexy::parse_events::error, lexy::error<lexy::_acfr<lexy::_prc>, lexy::expected_literal> >