instantiate variables in numerical comparisons
This commit is contained in:
@@ -304,6 +304,14 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
{
|
||||
match ct {
|
||||
&InlinedClauseType::CompareNumber(cmp, ..) => {
|
||||
if let &Term::Var(ref vr, ref name) = terms[0].as_ref() {
|
||||
self.mark_non_callable(name.clone(), 2, term_loc, vr, code);
|
||||
}
|
||||
|
||||
if let &Term::Var(ref vr, ref name) = terms[1].as_ref() {
|
||||
self.mark_non_callable(name.clone(), 2, term_loc, vr, code);
|
||||
}
|
||||
|
||||
let (mut lcode, at_1) = self.call_arith_eval(terms[0].as_ref(), 1)?;
|
||||
let (mut rcode, at_2) = self.call_arith_eval(terms[1].as_ref(), 2)?;
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ pub enum EvalError {
|
||||
// FloatOverflow,
|
||||
// IntOverflow,
|
||||
// Undefined,
|
||||
// Underflow,
|
||||
// FloatUnderflow,
|
||||
ZeroDivisor,
|
||||
NoRoots
|
||||
}
|
||||
@@ -262,7 +262,7 @@ impl EvalError {
|
||||
// EvalError::FloatOverflow => "float_overflow",
|
||||
// EvalError::IntOverflow => "int_overflow",
|
||||
// EvalError::Undefined => "undefined",
|
||||
// EvalError::Underflow => "underflow",
|
||||
// EvalError::FloatUnderflow => "underflow",
|
||||
EvalError::ZeroDivisor => "zero_divisor",
|
||||
EvalError::NoRoots => "no_roots"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user