tzlaine / parser

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

document stream error handlers #81

Closed akrzemi1 closed 8 months ago

akrzemi1 commented 8 months ago

The documentaiton for the stream_error_handler is confusing: https://tzlaine.github.io/parser/doc/html/boost/parser/stream_error_handler.html

I would expect its constructor to take a reference to an ostream object, but anything it takes consistently is the argument of type string_view.

Why do I need to provide a file name? Is it the name of the file that represents the output stream? Or is it supposed to be the name of the file that is concatenated into every error message? This needs to be documented.

tzlaine commented 8 months ago

That's just the reference doc, but it does state that it takes ostreams, and that if you don't supply them it uses std::cerr. It also tells you that the name of the string_view is "filename". I'm not sure what more you want.

Anyway, I think the use of filename is pretty well explained in the tutorial:

https://tzlaine.github.io/parser/doc/html/boost_parser__proposed_/tutorial/error_handling_and_debugging.html