This commit is contained in:
Patrick Lühne 2020-04-28 02:35:46 +02:00
parent 31805fa9d8
commit 35937d7930
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -28,7 +28,6 @@ pub enum Kind
UnexpectedToken, UnexpectedToken,
EmptyInput, EmptyInput,
ExpectedLogicalConnectiveArgument(String), ExpectedLogicalConnectiveArgument(String),
ExpectedComparisonArgument(String),
MultipleComparisonOperators(crate::ComparisonOperator, crate::ComparisonOperator), MultipleComparisonOperators(crate::ComparisonOperator, crate::ComparisonOperator),
} }
@ -102,12 +101,6 @@ impl Error
Self::new(Kind::ExpectedLogicalConnectiveArgument(logical_connective_name), location) Self::new(Kind::ExpectedLogicalConnectiveArgument(logical_connective_name), location)
} }
pub(crate) fn new_comparison_argument(comparison_operator_name: String, location: Location)
-> Self
{
Self::new(Kind::ExpectedComparisonArgument(comparison_operator_name), location)
}
pub(crate) fn new_multiple_comparison_operators( pub(crate) fn new_multiple_comparison_operators(
comparison_operator_1: crate::ComparisonOperator, comparison_operator_1: crate::ComparisonOperator,
comparison_operator_2: crate::ComparisonOperator, location: Location) comparison_operator_2: crate::ComparisonOperator, location: Location)
@ -147,9 +140,6 @@ impl std::fmt::Debug for Error
Kind::ExpectedLogicalConnectiveArgument(ref logical_connective_name) => Kind::ExpectedLogicalConnectiveArgument(ref logical_connective_name) =>
write!(formatter, "this “{}” logical connective is missing an argument", write!(formatter, "this “{}” logical connective is missing an argument",
logical_connective_name)?, logical_connective_name)?,
Kind::ExpectedComparisonArgument(ref comparison_operator_name) =>
write!(formatter, "this “{}” comparison is missing an argument",
comparison_operator_name)?,
Kind::MultipleComparisonOperators(comparison_operator_1, comparison_operator_2) => Kind::MultipleComparisonOperators(comparison_operator_1, comparison_operator_2) =>
write!(formatter, "chained comparisons arent supported (found “{:?}” and “{:?}” in the same formula), consider separating them with “and”", write!(formatter, "chained comparisons arent supported (found “{:?}” and “{:?}” in the same formula), consider separating them with “and”",
comparison_operator_1, comparison_operator_2)?, comparison_operator_1, comparison_operator_2)?,