tzlaine / parser

A C++ parser combinator library.
Boost Software License 1.0
69 stars 12 forks source link

Improve error reporting for `symbols` #164

Closed AlexBAV closed 3 months ago

AlexBAV commented 3 months ago

Currently, if symbols parser is used as an expectation point and no value matches, something similar to the following is generated as an error message:

symbols<EnumName> v { ... };

parse(r, "command1=" > v);

Generated error:

1:32: error: Expected symbols<enum EnumName>[<<action>>] here

Is it possible to provide a way to set a custom "error message", maybe by introducing a new symbols constructor overload (and/or a member function that can be called to set such a message)?

tzlaine commented 3 months ago

This is clearly an oversight no my part. Thanks for pointing this out!

AlexBAV commented 3 months ago

That are really great news, thank you!