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);
        }
Esempio n. 3
0
 public ISet <DescriptorKind> Visit(ModuloExpression expression)
 {
     return(_moduloRule.Transfer(expression, this));
 }
 public IEnumerable <Expression> Visit(ModuloExpression expression)
 {
     return(_VisitBinary(expression));
 }
Esempio n. 5
0
 public Expression Visit(ModuloExpression expression)
 {
     return(_VisitBinary(expression, (left, right) => new ModuloExpression(left, right)));
 }
Esempio n. 6
0
 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));
 }
Esempio n. 8
0
 public virtual void VisitModuloExpression(ModuloExpression moduloExpression)
 {
     DefaultVisit(moduloExpression);
 }
Esempio n. 9
0
 public override LE.Expression Visit(ModuloExpression moduloExpression) => this.VisitBinaryCore(moduloExpression, LE.Expression.Modulo);
 public void Visit(ModuloExpression expression)
 {
     _VisitBinaryExpression(expression);
 }