Type Alias ParseResult

pub type ParseResult<T> = Result<T, ParseError>;
Expand description

The result type returned by parsing functions.

Errors are emitted to the compiler driver’s diagnostics rather than returned through the type system. One reason for this is that a parsing function may need to emit more than one error. In addition, parsing functions may need to emit warnings too and we use the same diagnostics for both errors and warnings (since warnings may be treated as errors).

Aliased Type§

pub enum ParseResult<T> {
    Ok(T),
    Err(ParseError),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(ParseError)

Contains the error value