Struct xswag_syntax_java::lex::Error [] [src]

pub struct Error<P> {
    pub report: Report,
    pub poison: Option<P>,
}

Type returned by the Tokenizer in case of a lexing error. Contains a detailed report and may contain poisoned token that could be used to proceed normally.

Fields

report: Report

Detailed information about the error. Intended for user-friendly compiler messages.

poison: Option<P>

If an error occured but the lexer is able to recover, it emits a token. This token will probably contain some "wrong" information. For example: the java code '\j' contains a character literal with a wrong escape code. In this case the error contains a poisened token "Char(j)". So the backslash is ignored in order to get some semi usable token.

Methods

impl<P> Error<P>
[src]

fn map_poison<F, U>(self, op: F) -> Error<U> where F: FnOnce(P) -> U

Returns a new version with a changed poison

fn map_report<F>(self, op: F) -> Error<P> where F: FnOnce(Report) -> Report

Returns a new version with a changed report

Trait Implementations

impl<P: Debug> Debug for Error<P>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<P: Eq> Eq for Error<P>
[src]

impl<P: PartialEq> PartialEq for Error<P>
[src]

fn eq(&self, __arg_0: &Error<P>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Error<P>) -> bool

This method tests for !=.

impl<P: Clone> Clone for Error<P>
[src]

fn clone(&self) -> Error<P>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more