Esc

json_reader_error

procedureextensionsince 0.36.1Source
  • macOS: json_reader_error works on macOS
  • Linux: json_reader_error works on Linux
  • Windows: json_reader_error works on Windows
  • Wasm: json_reader_error works on Wasm

The reader's error with its line, column and path filled in; the caller owns it and frees it with free_json.

Signature

json_reader_error :: (r: *Json_Reader) -> Json_Error
Example↗
r: Json_Reader;
json_reader_init(*r, "[1, 2");
defer json_reader_free(*r);
assert(!json_skip_value(*r));
error := json_reader_error(*r);
assert(error.kind == .SYNTAX && error.line == 1);
free_json(*error);

See also