yhirose / cpp-peglib

A single file C++ header-only PEG (Parsing Expression Grammars) library
MIT License
879 stars 112 forks source link

Throw from action gets confusing error #273

Closed diyessi closed 1 year ago

diyessi commented 1 year ago

If an action throws, for example because an any_cast has the wrong type, the problem typically (for me, at least) shows up in the ~Context at assert(cut_stack.empty());, which can be very confusing until you realize what is really going on.

curldivergence commented 1 year ago

Btw the same problem was mentioned in #269, for now I’ve just commented out that assertion from cpp-peglib.

yhirose commented 1 year ago

@diyessi, @curldivergence could you try the latest peglib.h? Hope it fixes the issue.