parent
a3faefb893
commit
0e2ca4a489
@ -62,6 +62,11 @@ impl fmt::Display for EvalexprError {
|
|||||||
TypeError { expected, actual } => {
|
TypeError { expected, actual } => {
|
||||||
write!(f, "Expected one of {:?}, but got {:?}.", expected, actual)
|
write!(f, "Expected one of {:?}, but got {:?}.", expected, actual)
|
||||||
},
|
},
|
||||||
|
WrongTypeCombination { operator, actual } => write!(
|
||||||
|
f,
|
||||||
|
"The operator {:?} was called with a wrong combination of types: {:?}",
|
||||||
|
operator, actual
|
||||||
|
),
|
||||||
UnmatchedLBrace => write!(f, "Found an unmatched opening parenthesis '('."),
|
UnmatchedLBrace => write!(f, "Found an unmatched opening parenthesis '('."),
|
||||||
UnmatchedRBrace => write!(f, "Found an unmatched closing parenthesis ')'."),
|
UnmatchedRBrace => write!(f, "Found an unmatched closing parenthesis ')'."),
|
||||||
UnmatchedPartialToken { first, second } => {
|
UnmatchedPartialToken { first, second } => {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
use crate::{token::PartialToken, value::value_type::ValueType};
|
use crate::{token::PartialToken, value::value_type::ValueType};
|
||||||
|
|
||||||
use crate::value::Value;
|
use crate::{operator::Operator, value::Value};
|
||||||
|
|
||||||
mod display;
|
mod display;
|
||||||
|
|
||||||
@ -112,6 +112,14 @@ pub enum EvalexprError {
|
|||||||
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.
|
/// An opening brace without a matching closing brace was found.
|
||||||
UnmatchedLBrace,
|
UnmatchedLBrace,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user