Enum nu_errors::ParseErrorReason [−][src]
pub enum ParseErrorReason {
Eof {
expected: String,
span: Span,
},
ExtraTokens {
actual: Spanned<String>,
},
Mismatch {
expected: String,
actual: Spanned<String>,
},
Unclosed {
delimiter: String,
span: Span,
},
GeneralError {
message: String,
label: Spanned<String>,
},
ArgumentError {
command: Spanned<String>,
error: ArgumentError,
},
}
Expand description
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
The parser encountered an EOF rather than what it was expecting
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.
The parser encountered something other than what it was expecting
Unclosed delimiter
An unexpected internal error has occurred
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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for ParseErrorReason
impl Send for ParseErrorReason
impl Sync for ParseErrorReason
impl Unpin for ParseErrorReason
impl UnwindSafe for ParseErrorReason
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.