parser
parser copied to clipboard
Single parser error handler
When a single, primitive parser is used, the error stream remains empty, even if an error occurs. In the example below, 'oss' is empty, but it should have an error message, shouldn't it?
#include <boost/parser/parser.hpp>
int main()
{
using namespace boost::parser;
constexpr auto parser = string("test");
{
char const * str = "abz";
std::ostringstream oss;
stream_error_handler eh("simple_parser.cpp", oss);
auto result = parse(str, with_error_handler(parser, eh));
std::cout << oss.str();
}
}