fix stack overflow error

This commit is contained in:
collin 2020-08-13 23:46:14 -07:00
parent 6cdf0983f8
commit 17540a6bd6

View File

@ -331,10 +331,16 @@ impl<'ast> From<BinaryExpression<'ast>> for Expression {
Box::new(Expression::from(*expression.right)), Box::new(Expression::from(*expression.right)),
Span::from(expression.span), Span::from(expression.span),
), ),
BinaryOperation::Ne => Expression::Not( BinaryOperation::Ne => {
Box::new(Expression::from(expression.clone())), let span = Span::from(expression.span);
Span::from(expression.span), let negated = Expression::Eq(
), Box::new(Expression::from(*expression.left)),
Box::new(Expression::from(*expression.right)),
span.clone(),
);
Expression::Not(Box::new(negated), span.clone())
}
BinaryOperation::Ge => Expression::Ge( BinaryOperation::Ge => Expression::Ge(
Box::new(Expression::from(*expression.left)), Box::new(Expression::from(*expression.left)),
Box::new(Expression::from(*expression.right)), Box::new(Expression::from(*expression.right)),