pub struct PrdError {
pub err_message: String,
pub token_index: usize,
pub rule: u32,
pub in_alt: u16,
pub alt_progress: Option<u16>,
pub on_behalf_of_rule: u32,
}Expand description
Parser error state.
Fields§
§err_message: StringHuman-readable error message. Format is not guaranteed and may change arbitrarily.
token_index: usizeHow far into the token stream did we successfully parse? Note: this is NOT
rule: u32Which rule’s alternations were we inside of? (Index into bnf::Grammar::points)
in_alt: u16Which alternation was it?
If u16::MAX, we errored out before entering an alternation.
If past the end of the grammar point’s list of alternations, then every alternation was checked and failed.
alt_progress: Option<u16>Where were we inside of that alternation?
If “None”, we errored on a guard/lookahead test.
on_behalf_of_rule: u32On behalf of what rule were we parsing for? (e.g. the parent of a $become)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrdError
impl RefUnwindSafe for PrdError
impl Send for PrdError
impl Sync for PrdError
impl Unpin for PrdError
impl UnwindSafe for PrdError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more