Function yaml_peg::indicated_msg[][src]

pub fn indicated_msg(doc: &str, 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("{\"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.