示例#1
0
        public void TestIntegers()
        {
            var a = _e.Num(1);
            var b = _e.Num(2);

            Assert.AreEqual(_e.Num(3), a + b);
            Assert.AreEqual(_e.Num(-1), a - b);
            Assert.AreEqual(b, a * b);
        }
示例#2
0
        public override void ExitMapApplyRule(WolframLanguageParser.MapApplyRuleContext context)
        {
            var text = context.mapApplyOperator().GetText();

            if (text == "@@@")
            {
                Push(_engine.Expr(_engine.System.List, _engine.Num(1)));
                Construct(_engine.System.Apply, 3);
            }
            else
            {
                Construct(GetSymbolForOp(text), 2);
            }
        }
示例#3
0
 public void TestIntParse()
 {
     Assert.AreEqual(_engine.Num(1), _engine.Parse("1"));
 }