eval method
Compares as booleans if either side is a boolean, else as numbers (within 1e-12) if either is a number, else as strings.
Implementation
@override
Object eval(DataInstance? model, EvaluationContext context) {
final x = unpack(a.eval(model, context));
final y = unpack(b.eval(model, context));
final bool same;
if (x is bool || y is bool) {
same = (x is bool ? x : toBoolean(x)) == (y is bool ? y : toBoolean(y));
} else if (x is double || y is double) {
final dx = x is double ? x : toNumeric(x);
final dy = y is double ? y : toNumeric(y);
same = (dx - dy).abs() < 1e-12;
} else {
same = toXPathString(x) == toXPathString(y);
}
return equal == same;
}