11471 {
11472 std::string error_msg = "syntax error ";
11473
11474 if (!context.empty())
11475 {
11476 error_msg += "while parsing " + context + " ";
11477 }
11478
11479 error_msg += "- ";
11480
11482 {
11485 }
11486
11487 else
11488 {
11490 }
11491
11492 if (expected != token_type::uninitialized)
11493 {
11495 }
11496
11497 return error_msg;
11498 }
JSON_HEDLEY_RETURNS_NON_NULL static JSON_HEDLEY_CONST const char * token_type_name(const token_type t) noexcept
return name of values of type token_type (only used for errors)
std::string get_token_string() const
return the last read token (for errors only).
JSON_HEDLEY_RETURNS_NON_NULL constexpr const char * get_error_message() const noexcept
return syntax error message
token_type last_token
the type of the last read token