nushell/crates/nu-parser/src/errors.rs

35 lines
1 KiB
Rust
Raw Normal View History

2021-09-02 22:58:15 +00:00
use nu_protocol::{Span, Type};
2021-08-10 18:51:08 +00:00
2021-08-16 23:00:00 +00:00
#[derive(Debug)]
pub enum ParseError {
ExtraTokens(Span),
ExtraPositional(Span),
UnexpectedEof(String, Span),
Unclosed(String, Span),
UnknownStatement(Span),
Expected(String, Span),
Mismatch(String, String, Span), // expected, found, span
UnsupportedOperation(Span, Span, Type, Span, Type),
ExpectedKeyword(String, Span),
MultipleRestParams(Span),
VariableNotFound(Span),
UnknownCommand(Span),
NonUtf8(Span),
UnknownFlag(Span),
UnknownType(Span),
MissingFlagParam(Span),
ShortFlagBatchCantTakeArg(Span),
MissingPositional(String, Span),
2021-08-26 23:44:08 +00:00
KeywordMissingArgument(String, Span),
2021-08-16 23:00:00 +00:00
MissingType(Span),
TypeMismatch(Type, Type, Span), // expected, found, span
MissingRequiredFlag(String, Span),
IncompleteMathExpression(Span),
UnknownState(String, Span),
IncompleteParser(Span),
2021-08-26 23:44:08 +00:00
RestNeedsName(Span),
2021-09-08 18:54:27 +00:00
ExtraColumns(usize, Span),
MissingColumns(usize, Span),
2021-09-13 19:59:11 +00:00
AssignmentMismatch(String, String, Span),
2021-08-16 23:00:00 +00:00
}