[][src]Enum nu_errors::ParseErrorReason

pub enum ParseErrorReason {
    Eof {
        expected: String,
        span: Span,
    },
    ExtraTokens {
        actual: Spanned<String>,
    },
    Mismatch {
        expected: String,
        actual: Spanned<String>,
    },
    InternalError {
        message: Spanned<String>,
    },
    ArgumentError {
        command: Spanned<String>,
        error: ArgumentError,
    },
}

A structured reason for a ParseError. Note that parsing in nu is more like macro expansion in other languages, so the kinds of errors that can occur during parsing are more contextual than you might expect.

Variants

Eof

The parser encountered an EOF rather than what it was expecting

Fields of Eof

expected: Stringspan: Span
ExtraTokens

The parser expected to see the end of a token stream (possibly the token stream from inside a delimited token node), but found something else.

Fields of ExtraTokens

actual: Spanned<String>
Mismatch

The parser encountered something other than what it was expecting

Fields of Mismatch

expected: Stringactual: Spanned<String>
InternalError

An unexpected internal error has occurred

Fields of InternalError

message: Spanned<String>
ArgumentError

The parser tried to parse an argument for a command, but it failed for some reason

Fields of ArgumentError

command: Spanned<String>error: ArgumentError

Trait Implementations

impl Clone for ParseErrorReason[src]

impl Debug for ParseErrorReason[src]

impl<'de> Deserialize<'de> for ParseErrorReason[src]

impl Eq for ParseErrorReason[src]

impl Hash for ParseErrorReason[src]

impl Ord for ParseErrorReason[src]

impl PartialEq<ParseErrorReason> for ParseErrorReason[src]

impl PartialOrd<ParseErrorReason> for ParseErrorReason[src]

impl Serialize for ParseErrorReason[src]

impl StructuralEq for ParseErrorReason[src]

impl StructuralPartialEq for ParseErrorReason[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SpannedItem for T[src]

impl<T> TaggedItem for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.