Ejemplo n.º 1
0
 public void Execute(Dictionary <string, string> variables, out string result, out TokenType resultType, Tokenizer tokenizer = null)
 {
     resultType = TokenType.IfKeyword;
     result     = string.Empty;
     if (condition.Evaluate(variables))
     {
         expression.Execute(variables, out result, out resultType, tokenizer);
     }
 }
Ejemplo n.º 2
0
        public void TestExpressionStatement()
        {
            ExecutionEnvironment e = new ExecutionEnvironment();

            e.RegisterValue("a", 5);
            Identifier i = new Identifier();

            i.Variable = "a";
            ExpressionStatement s = new ExpressionStatement();

            s.Expression = i;
            var c = s.Execute(e);

            Assert.AreEqual(c.ReturnValue, 5);
        }