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

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

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]

Returns a new version with a changed poison

Returns a new version with a changed report

Trait Implementations

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

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

This method tests for !=.

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

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

Formats the value using the given formatter.