public void CanAddStrings() { OpAdd add = new OpAdd(); add.addChild( new StringLiteralNode("20")); add.addChild( new StringLiteralNode("30")); object result = add.GetValue(null, null); Assert.AreEqual("2030", result); }
public void CanAddNumbers() { OpAdd add = new OpAdd(); add.addChild( new IntLiteralNode("20")); add.addChild( new IntLiteralNode("30")); object result = add.GetValue(null, null); Assert.AreEqual(50, result); }
public void CanAddNumbers() { OpAdd add = new OpAdd(); add.addChild(new IntLiteralNode("20")); add.addChild(new IntLiteralNode("30")); object result = add.GetValue(null, null); Assert.AreEqual(50, result); }
public void CanAddStrings() { OpAdd add = new OpAdd(); add.addChild(new StringLiteralNode("20")); add.addChild(new StringLiteralNode("30")); object result = add.GetValue(null, null); Assert.AreEqual("2030", result); }
public static void Rule(BinaryOp500 lhs, OpAdd op) { lhs.CodeFunctor = new CodeFunctor(op.Text, 2, true); }
public static Expr _Add(Expr lhs, OpAdd op, Expr rhs) { return(new AddExpr(lhs, rhs)); }