private QilNode CompareValues(XPathOperator op, QilNode left, QilNode right, XmlTypeCode compType)
{
Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String);
Debug.Assert(compType == XmlTypeCode.Boolean || left.XmlType !.IsSingleton && right.XmlType !.IsSingleton, "Both comparison operands must be singletons");
left = _f.ConvertToType(compType, left);
right = _f.ConvertToType(compType, right);
switch (op)
{
case XPathOperator.Eq: return(_f.Eq(left, right));
case XPathOperator.Ne: return(_f.Ne(left, right));
case XPathOperator.Lt: return(_f.Lt(left, right));
case XPathOperator.Le: return(_f.Le(left, right));
case XPathOperator.Gt: return(_f.Gt(left, right));
case XPathOperator.Ge: return(_f.Ge(left, right));
default:
Debug.Fail("Wrong operator type");
return(null);
}
}