TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ exception_message()

template<typename BasicJsonType , typename InputAdapterType >
std::string nlohmann::detail::parser< BasicJsonType, InputAdapterType >::exception_message ( const token_type  expected,
const std::string &  context 
)
inlineprivate

Definition at line 11470 of file json.hpp.

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
11481 if (last_token == token_type::parse_error)
11482 {
11483 error_msg += std::string(m_lexer.get_error_message()) + "; last read: '" +
11484 m_lexer.get_token_string() + "'";
11485 }
11486
11487 else
11488 {
11489 error_msg += "unexpected " + std::string(lexer_t::token_type_name(last_token));
11490 }
11491
11492 if (expected != token_type::uninitialized)
11493 {
11494 error_msg += "; expected " + std::string(lexer_t::token_type_name(expected));
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)
Definition: json.hpp:6627
std::string get_token_string() const
return the last read token (for errors only).
Definition: json.hpp:8053
JSON_HEDLEY_RETURNS_NON_NULL constexpr const char * get_error_message() const noexcept
return syntax error message
Definition: json.hpp:8080
lexer_t m_lexer
the lexer
Definition: json.hpp:11506
token_type last_token
the type of the last read token
Definition: json.hpp:11504