MCPcopy Create free account
hub / github.com/PeterFWS/Structure-PLP-SLAM / exception_message

Method exception_message

3rd/json/include/nlohmann/json.hpp:7470–7497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7468 }
7469
7470 std::string exception_message(const token_type expected, const std::string& context)
7471 {
7472 std::string error_msg = "syntax error ";
7473
7474 if (not context.empty())
7475 {
7476 error_msg += "while parsing " + context + " ";
7477 }
7478
7479 error_msg += "- ";
7480
7481 if (last_token == token_type::parse_error)
7482 {
7483 error_msg += std::string(m_lexer.get_error_message()) + "; last read: '" +
7484 m_lexer.get_token_string() + "'";
7485 }
7486 else
7487 {
7488 error_msg += "unexpected " + std::string(lexer_t::token_type_name(last_token));
7489 }
7490
7491 if (expected != token_type::uninitialized)
7492 {
7493 error_msg += "; expected " + std::string(lexer_t::token_type_name(expected));
7494 }
7495
7496 return error_msg;
7497 }
7498
7499 private:
7500 /// callback function

Callers

nothing calls this directly

Calls 3

get_error_messageMethod · 0.80
emptyMethod · 0.45
get_token_stringMethod · 0.45

Tested by

no test coverage detected