MCPcopy Create free account
hub / github.com/apache/tvm-ffi / GetSyntaxErrorContext

Method GetSyntaxErrorContext

src/ffi/extra/json_parser.cc:251–260  ·  view source on GitHub ↗

! * \brief Get the current line context. * \return The current line context. */

Source from the content-addressed store, hash-verified

249 * \return The current line context.
250 */
251 String GetSyntaxErrorContext(std::string err_prefix) const {
252 int64_t column = static_cast<int64_t>(cur_ - last_line_begin_) + 1;
253 int64_t char_pos = static_cast<int64_t>(cur_ - begin_);
254 if (err_prefix.empty()) {
255 err_prefix = "Syntax error";
256 }
257 err_prefix += ": line " + std::to_string(line_counter_) + " column " + std::to_string(column) +
258 " (char " + std::to_string(char_pos) + ")";
259 return String(err_prefix);
260 }
261
262 std::string FinalizeErrorMsg() {
263 if (error_msg_.empty()) {

Callers

nothing calls this directly

Calls 2

StringClass · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected