public void DispatchReal_ModuloAndObjectList_CorrectModuloExprPassed() { ModuloExpression expected = new ModuloExpression(null, null, 0, 0); ModuloExpression input1 = expected; List <Object> input2 = new List <Object>() { 23, 2.334, null }; IRealHelper rhelper = Substitute.For <IRealHelper>(); Interpreter interpreter = Utilities.GetIntepreterOnlyWith(rhelper); ModuloExpression res = null; rhelper.ModuloReal(Arg.Do <ModuloExpression>(x => res = x), Arg.Any <List <Object> >()); interpreter.DispatchReal(input1, input2); res.Should().BeEquivalentTo(expected); }
protected IExpression ParseTerm() { var left = ParseFactor(); while (Accept("*") || Accept("/") || Accept("%")) { if (Prev().Type == "*") { left = MultiplyExpression.Create(left, ParseFactor()); } else if (Prev().Type == "/") { left = DivideExpression.Create(left, ParseFactor()); } else { left = ModuloExpression.Create(left, ParseFactor()); } } return(left); }
public ISet <DescriptorKind> Visit(ModuloExpression expression) { return(_moduloRule.Transfer(expression, this)); }
public IEnumerable <Expression> Visit(ModuloExpression expression) { return(_VisitBinary(expression)); }
public Expression Visit(ModuloExpression expression) { return(_VisitBinary(expression, (left, right) => new ModuloExpression(left, right))); }
public override bool Visit(ModuloExpression moduloExpression) => this.VisitBinaryCore(moduloExpression, "%");
private bool _AreEqual(ModuloExpression a, ModuloExpression b) { return(AreEqual(a.Left, b.Left) && AreEqual(a.Right, b.Right)); }
public virtual void VisitModuloExpression(ModuloExpression moduloExpression) { DefaultVisit(moduloExpression); }
public override LE.Expression Visit(ModuloExpression moduloExpression) => this.VisitBinaryCore(moduloExpression, LE.Expression.Modulo);
public void Visit(ModuloExpression expression) { _VisitBinaryExpression(expression); }