/// A row was inserted to a table with the wrong amount of values.
WrongColumnAmount{
expected: usize,
actual: usize,
},
/// An operator was called with the wrong amount of arguments.
ExpectedOperatorArgumentAmount{
expected: usize,
actual: usize,
},
/// A function was called with the wrong amount of arguments.
ExpectedFunctionArgumentAmount{
identifier: String,
expected: usize,
actual: usize,
},
/// A function was called with the wrong amount of arguments.
ExpectedAtLeastFunctionArgumentAmount{
identifier: String,
minimum: usize,
actual: usize,
},
ExpectedString{
actual: Value,
},
ExpectedInt{
actual: Value,
},
ExpectedFloat{
actual: Value,
},
/// An integer, floating point or value was expected.
ExpectedNumber{
actual: Value,
},
/// An integer, floating point or string value was expected.
ExpectedNumberOrString{
actual: Value,
},
ExpectedBoolean{
actual: Value,
},
ExpectedList{
actual: Value,
},
ExpectedFixedLenList{
expected_len: usize,
actual: Value,
},
ExpectedEmpty{
actual: Value,
},
ExpectedMap{
actual: Value,
},
ExpectedTable{
actual: Value,
},
ExpectedFunction{
actual: Value,
},
/// A string, list, map or table value was expected.
ExpectedCollection{
actual: Value,
},
/// Tried to append a child to a leaf node.
/// Leaf nodes cannot have children.
AppendedToLeafNode(Node),
/// Tried to append a child to a node such that the precedence of the child
/// is not higher. This error should never occur. If it does, please file a
/// bug report.
PrecedenceViolation,
/// A `VariableIdentifier` operation did not find its value in the context.
VariableIdentifierNotFound(String),
/// A `FunctionIdentifier` operation did not find its value in the context.
FunctionIdentifierNotFound(String),
/// A value has the wrong type.
/// Only use this if there is no other error that describes the expected and
/// provided types in more detail.
TypeError{
/// The expected types.
expected: &'static[ValueType],
/// The actual value.
actual: Value,
},
/// A macro or function was called with the wrong type of input.
MacroArgumentType{
/// The macro that was called.
macro_info: MacroInfo<'static>,
/// The actual value.
actual: Value,
},
/// An operator is used with a wrong combination of types.
WrongTypeCombination{
/// The operator that whose evaluation caused the error.
operator: Operator,
/// The types that were used in the operator causing it to fail.
actual: Vec<ValueType>,
},
/// An opening brace without a matching closing brace was found.
UnmatchedLBrace,
/// A closing brace without a matching opening brace was found.
UnmatchedRBrace,
/// Left of an opening brace or right of a closing brace is a token that does not expect the brace next to it.
/// For example, writing `4(5)` would yield this error, as the `4` does not have any operands.
MissingOperatorOutsideOfBrace,
/// A `PartialToken` is unmatched, such that it cannot be combined into a full `Token`.
/// This happens if for example a single `=` is found, surrounded by whitespace.
/// It is not a token, but it is part of the string representation of some tokens.
UnmatchedPartialToken{
/// The unmatched partial token.
first: PartialToken,
/// The token that follows the unmatched partial token and that cannot be matched to the partial token, or `None`, if `first` is the last partial token in the stream.
second: Option<PartialToken>,
},
/// An addition operation performed by Rust failed.
AdditionError{
/// The first argument of the addition.
augend: Value,
/// The second argument of the addition.
addend: Value,
},
/// A subtraction operation performed by Rust failed.
SubtractionError{
/// The first argument of the subtraction.
minuend: Value,
/// The second argument of the subtraction.
subtrahend: Value,
},
/// A negation operation performed by Rust failed.
NegationError{
/// The argument of the negation.
argument: Value,
},
/// A multiplication operation performed by Rust failed.
MultiplicationError{
/// The first argument of the multiplication.
multiplicand: Value,
/// The second argument of the multiplication.
multiplier: Value,
},
/// A division operation performed by Rust failed.
DivisionError{
/// The first argument of the division.
dividend: Value,
/// The second argument of the division.
divisor: Value,
},
/// A modulation operation performed by Rust failed.
ModulationError{
/// The first argument of the modulation.
dividend: Value,
/// The second argument of the modulation.
divisor: Value,
},
/// A regular expression could not be parsed
InvalidRegex{
/// The invalid regular expression
regex: String,
/// Failure message from the regex engine
message: String,
},
/// A modification was attempted on a `Context` that does not allow modifications.
ContextNotMutable,
/// An escape sequence within a string literal is illegal.
IllegalEscapeSequence(String),
/// This context does not allow enabling builtin functions.
BuiltinFunctionsCannotBeEnabled,
/// This context does not allow disabling builtin functions.