pub enum ParseError {
Show 24 variants
SyntaxError {
span: SourceSpan,
message: String,
suggestion: Option<Suggestion>,
},
NotSupported {
span: SourceSpan,
rule: Rule,
},
Unexpected {
span: SourceSpan,
rule: Rule,
expected: Vec<Rule>,
},
UnexpectedTokens {
span: SourceSpan,
rules: Vec<Rule>,
},
EOF {
span: SourceSpan,
},
InvalidFloat(ParseFloatError),
InvalidInteger(ParseIntError),
InvalidBool(ParseBoolError),
InvalidDate(ParseError),
InvalidRegex(Error),
UnsupportedAlignFunction {
span: SourceSpan,
name: String,
},
UnsupportedGroupFunction {
span: SourceSpan,
name: String,
},
UnsupportedComputeFunction {
span: SourceSpan,
name: String,
},
UnsupportedBucketFunction {
span: SourceSpan,
name: String,
},
UnsupportedMapEvaluation {
span: SourceSpan,
name: String,
},
UnsupportedMapFunction {
span: SourceSpan,
name: String,
},
UnsupportedRegexpComparison {
span: SourceSpan,
op: String,
},
UnsupportedTagComparison {
span: SourceSpan,
op: String,
},
NotImplemented(&'static str),
StrumbraError(Error),
Unreachable(&'static str),
ParamDefinedMultipleTimes {
span: SourceSpan,
param: String,
},
UndefinedParam {
span: SourceSpan,
param: String,
},
InvalidTagType {
span: SourceSpan,
tpe: String,
},
}Expand description
MPL parsing error
Variants§
SyntaxError
Syntax error with source location.
Fields
span: SourceSpanThe source location of the error with detailed message
suggestion: Option<Suggestion>Optional suggestion for fixing the error
NotSupported
Rule for a unsupported feature
Fields
span: SourceSpanThe source location of the unsupported feature
rule: RuleThe rule that is not supported
Unexpected
Unexpected rule
Fields
span: SourceSpanThe source location of the unexpected rule
rule: RuleThe rule that was unexpected
UnexpectedTokens
Unexpected Token
Fields
span: SourceSpanThe source location of the unexpected tokens
EOF
Unexpected EOF
Fields
span: SourceSpanThe source location where more input was expected
InvalidFloat(ParseFloatError)
Invalid Floating point number
InvalidInteger(ParseIntError)
Invalid Integer
InvalidBool(ParseBoolError)
Invalid bool
InvalidDate(ParseError)
Invalid date
InvalidRegex(Error)
Invalid Regex
UnsupportedAlignFunction
Unsupported align function
Fields
span: SourceSpanThe source location of the unsupported function
UnsupportedGroupFunction
Unsupported group function
Fields
span: SourceSpanThe source location of the unsupported function
UnsupportedComputeFunction
Unsupported compute function
Fields
span: SourceSpanThe source location of the unsupported function
UnsupportedBucketFunction
Unsupported bucketing function
Fields
span: SourceSpanThe source location of the unsupported function
UnsupportedMapEvaluation
Unsupported map evaluation
Fields
span: SourceSpanThe source location of the unsupported operation
UnsupportedMapFunction
Unsupported map function
Fields
span: SourceSpanThe source location of the unsupported function
UnsupportedRegexpComparison
Unsupported regexp comparison
Fields
span: SourceSpanThe source location of the unsupported operator
UnsupportedTagComparison
Unsupported comparison against tag value
Fields
span: SourceSpanThe source location of the unsupported operator
NotImplemented(&'static str)
The feature is not implemented yet
StrumbraError(Error)
Strumbra error
Unreachable(&'static str)
Unreachable error
ParamDefinedMultipleTimes
Param is defined multiple times
UndefinedParam
Param is not defined
InvalidTagType
Invalid tag type
Trait Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl Diagnostic for ParseError
impl Diagnostic for ParseError
Source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz) is recommended, but more classic codes like
E0123 or enums will work just fine.Source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic’s Diagnostic::source_codeSource§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandlers to change the display format
of this diagnostic. Read moreSource§fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Diagnostic.Source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic’s Diagnostic::labels to.Diagnostics.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()