Struct mech_syntax::parser::ParseString
source · pub struct ParseString<'a> {
pub graphemes: &'a Vec<&'a str>,
pub error_log: Vec<(SourceRange, ParseErrorDetail)>,
pub cursor: usize,
pub location: SourceLocation,
}
Expand description
The input type for nom parsers. Instead of holding the actual input string, this struct only holds a reference to that string so that it can be cloned at much lower cost.
Fields§
§graphemes: &'a Vec<&'a str>
Source code
error_log: Vec<(SourceRange, ParseErrorDetail)>
Error report, a list of (error_location, error_context)
cursor: usize
Point at the next grapheme to consume
location: SourceLocation
Location of the grapheme pointed by cursor
Implementations§
Trait Implementations§
source§impl<'a> Clone for ParseString<'a>
impl<'a> Clone for ParseString<'a>
source§fn clone(&self) -> ParseString<'a>
fn clone(&self) -> ParseString<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for ParseString<'a>
impl<'a> Debug for ParseString<'a>
source§impl<'a> InputLength for ParseString<'a>
impl<'a> InputLength for ParseString<'a>
Required by nom
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