Trait chumsky::error::Error[][src]

pub trait Error<I>: Sized {
    type Span: Span;
    type Label;
    fn expected_input_found<Iter: IntoIterator<Item = I>>(
        span: Self::Span,
        expected: Iter,
        found: Option<I>
    ) -> Self;
fn with_label(self, label: Self::Label) -> Self;
fn merge(self, other: Self) -> Self; fn unclosed_delimiter(
        _start_span: Self::Span,
        _start: I,
        span: Self::Span,
        expected: I,
        found: Option<I>
    ) -> Self { ... } }
Expand description

A trait that describes parser error types.

Associated Types

The type of spans to be used in the error.

The label used to describe a syntatic structure currently being parsed.

This can be used to generate errors that tell the user what syntactic structure was currently being parsed when the error occured.

Required methods

The primary span that the error originated at, if one exists. Create a new error describing a conflict between expected inputs and that which was actually found.

Using a None as found indicates that the end of input was reached, but was not expected.

Indicate that the error occured while parsing a particular syntactic structure.

Merge two errors that point to the same input together, combining their information.

Provided methods

Create a new error describing a delimiter that was not correctly closed.

Provided to this function is the span of the unclosed delimiter, the delimiter itself, the span of the input that was found in its place, the closing delimiter that was expected but not found, and the input that was found in its place.

Implementors