MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / exception_message

Method exception_message

Source/external/json.hpp:12564–12591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12562 }
12563
12564 std::string exception_message(const token_type expected, const std::string& context)
12565 {
12566 std::string error_msg = "syntax error ";
12567
12568 if (!context.empty())
12569 {
12570 error_msg += concat("while parsing ", context, ' ');
12571 }
12572
12573 error_msg += "- ";
12574
12575 if (last_token == token_type::parse_error)
12576 {
12577 error_msg += concat(m_lexer.get_error_message(), "; last read: '",
12578 m_lexer.get_token_string(), '\'');
12579 }
12580 else
12581 {
12582 error_msg += concat("unexpected ", lexer_t::token_type_name(last_token));
12583 }
12584
12585 if (expected != token_type::uninitialized)
12586 {
12587 error_msg += concat("; expected ", lexer_t::token_type_name(expected));
12588 }
12589
12590 return error_msg;
12591 }
12592
12593 private:
12594 /// callback function

Callers

nothing calls this directly

Calls 3

concatFunction · 0.85
emptyMethod · 0.80
get_token_stringMethod · 0.80

Tested by

no test coverage detected