Function yaml_peg::indicated_msg

source ·
pub fn indicated_msg(doc: &[u8], pos: u64) -> String
Expand description

Indicate the position of the documentation. This function will show the line number and column number of the position.

use yaml_peg::indicated_msg;

let doc = indicated_msg(b"{\"a\": \n[\"b\", \"c\", \"d\"]}", 13);
assert_eq!(doc, "2:7\n[\"b\", \"c\", \"d\"]}\n      ^")

If print the string, it would be like:

2:7
["b", "c", "d"]}
      ^

This may be what you need if you went to indicate an error on the invalid data.