public override ExprNode Validate(ExprValidationContext validationContext) { evaluators = ExprNodeUtilityQuery.GetEvaluatorsNoCompile(ChildNodes); var typeOne = ChildNodes[0].Forge.EvaluationType; var typeTwo = ChildNodes[1].Forge.EvaluationType; if (!typeOne.IsNumericNonFP() || !typeTwo.IsNumericNonFP()) { throw new ExprValidationException("Range operator requires integer-type parameters"); } return null; }
public override ExprNode Validate(ExprValidationContext validationContext) { // all nodes must either be int, frequency or range evaluators = ExprNodeUtilityQuery.GetEvaluatorsNoCompile(ChildNodes); for (var i = 0; i < ChildNodes.Length; i++) { var type = ChildNodes[i].Forge.EvaluationType; if (type == typeof(FrequencyParameter) || type == typeof(RangeParameter)) { continue; } if (!type.IsNumericNonFP()) { throw new ExprValidationException("Frequency operator requires an integer-type parameter"); } } return null; }