Exemple #1
0
 public override object Execute(NameEnv env)
 {
     foreach (IfStmtTest t in tests)
     {
         object val = t.test.Evaluate(env);
         if (Ops.IsTrue(val))
         {
             return(t.body.Execute(env));
         }
     }
     if (elseStmt != null)
     {
         return(elseStmt.Execute(env));
     }
     return(NextStmt);
 }
Exemple #2
0
        public override object Execute(NameEnv env)
        {
            object ret = NextStmt;

            while (Ops.IsTrue(test.Evaluate(env)))
            {
                ret = body.Execute(env);
                if (ret != NextStmt)
                {
                    break;
                }
            }
            return(ret);
            //			if (else_ != null) {
            //				else_.exec(env);
            //			}
        }
Exemple #3
0
        public override object Execute(NameEnv env)
        {
            object ret = Stmt.NextStmt;

            IEnumerator i = Ops.GetEnumerator(list.Evaluate(env));

            while (i.MoveNext())
            {
                lhs.Assign(i.Current, env);
                ret = body.Execute(env);
                if (ret != NextStmt)
                {
                    return(ret);
                }
            }

            return(ret);
            //			if (else_ != null) {
            //				else_.exec(env);
            //			}
        }