Struct nom_supreme::final_parser::Location [−][src]
Expand description
A location in a string where an error may have occurred. In keeping with the typical practice from editors and other tools, line and columns are both 1-indexed.
Example
use nom_supreme::final_parser::{RecreateContext, Location};
let original_input = "Hello,\nWorld!\n";
let tail = &original_input[9..];
assert_eq!(
Location::recreate_context(original_input, tail),
Location { line: 2, column: 3 },
);Fields
line: usizeThe line number in the original input where the error occurred
column: usizeThe column of the line in the original input where the error occurred
Implementations
Given the original input string, as well as the context reported by nom, compute the location in the original string where the error occurred.
This function will report garbage (and may panic) if the context is not associated with the input
Trait Implementations
Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
Auto Trait Implementations
impl RefUnwindSafe for Location
impl UnwindSafe for Location
Blanket Implementations
Mutably borrows from an owned value. Read more
Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more