mirror of
https://github.com/boostorg/parser.git
synced 2026-01-24 18:12:32 +00:00
Emit parse errors via callback instead of just dumping them to the console.
This commit is contained in:
@@ -9,7 +9,8 @@ int main()
|
||||
break;
|
||||
|
||||
boost::optional<boost::json::value> value;
|
||||
if ((value = boost::json::parse(str))) {
|
||||
if ((value = boost::json::parse(
|
||||
str, [](std::string const & msg) { std::cout << msg; }))) {
|
||||
std::cout << "Parsed value:\n";
|
||||
std::cout << *value << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user