MCPcopy Create free account
hub / github.com/LAStools/LAStools / exception_message

Method exception_message

src/json.hpp:12650–12677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12648 }
12649
12650 std::string exception_message(const token_type expected, const std::string& context)
12651 {
12652 std::string error_msg = "syntax error ";
12653
12654 if (!context.empty())
12655 {
12656 error_msg += concat("while parsing ", context, ' ');
12657 }
12658
12659 error_msg += "- ";
12660
12661 if (last_token == token_type::parse_error)
12662 {
12663 error_msg += concat(m_lexer.get_error_message(), "; last read: '",
12664 m_lexer.get_token_string(), '\'');
12665 }
12666 else
12667 {
12668 error_msg += concat("unexpected ", lexer_t::token_type_name(last_token));
12669 }
12670
12671 if (expected != token_type::uninitialized)
12672 {
12673 error_msg += concat("; expected ", lexer_t::token_type_name(expected));
12674 }
12675
12676 return error_msg;
12677 }
12678
12679 private:
12680 /// 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