MCPcopy Create free account
hub / github.com/bupticybee/TexasSolver / exception_message

Method exception_message

include/json.hpp:9109–9136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9107 }
9108
9109 std::string exception_message(const token_type expected, const std::string& context)
9110 {
9111 std::string error_msg = "syntax error ";
9112
9113 if (not context.empty())
9114 {
9115 error_msg += "while parsing " + context + " ";
9116 }
9117
9118 error_msg += "- ";
9119
9120 if (last_token == token_type::parse_error)
9121 {
9122 error_msg += std::string(m_lexer.get_error_message()) + "; last read: '" +
9123 m_lexer.get_token_string() + "'";
9124 }
9125 else
9126 {
9127 error_msg += "unexpected " + std::string(lexer_t::token_type_name(last_token));
9128 }
9129
9130 if (expected != token_type::uninitialized)
9131 {
9132 error_msg += "; expected " + std::string(lexer_t::token_type_name(expected));
9133 }
9134
9135 return error_msg;
9136 }
9137
9138 private:
9139 /// 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