Struct mech_syntax::parser::ParseError
source · pub struct ParseError<'a> {
pub cause_range: SourceRange,
pub remaining_input: ParseString<'a>,
pub error_detail: ParseErrorDetail,
}
Expand description
The error type for the nom parser, which handles full error context (location + detail) and ownership of the input ParseString.
Eventually error context will be logged and ownership will be moved out.
Fields§
§cause_range: SourceRange
Cause range is defined as [start, end), where start
points at the first
character that’s catched by a label, and end
points at the next
character of the character that didn’t match.
Example: index: 1234567 input: abcdefg error: ~~~^ range: | | [2, 5)
remaining_input: ParseString<'a>
Hold ownership to the input ParseString
error_detail: ParseErrorDetail
Detailed information about this error
Implementations§
source§impl<'a> ParseError<'a>
impl<'a> ParseError<'a>
sourcepub fn new(input: ParseString<'a>, msg: &'static str) -> Self
pub fn new(input: ParseString<'a>, msg: &'static str) -> Self
Create a new error at current location of the input, with given message and empty annotations. Ownership of the input is also passed into this error object.
Trait Implementations§
source§impl<'a> Clone for ParseError<'a>
impl<'a> Clone for ParseError<'a>
source§fn clone(&self) -> ParseError<'a>
fn clone(&self) -> ParseError<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for ParseError<'a>
impl<'a> Debug for ParseError<'a>
source§impl<'a> ParseError<ParseString<'a>> for ParseError<'a>
impl<'a> ParseError<ParseString<'a>> for ParseError<'a>
Required by nom
source§fn from_error_kind(input: ParseString<'a>, _kind: ErrorKind) -> Self
fn from_error_kind(input: ParseString<'a>, _kind: ErrorKind) -> Self
Not used, unless we have logical error
source§fn append(_input: ParseString<'a>, _kind: ErrorKind, other: Self) -> Self
fn append(_input: ParseString<'a>, _kind: ErrorKind, other: Self) -> Self
Probably not used