public void Visit(ForLoop ast)
 {
     Exec(ast);
 }
        public void Visit(ForLoop ast)
        {
            ast.Setup.Visit(this);

            ast.Predicate.Visit(this);

            if (ResolvingTypes && ast.Predicate.AstSymbolType.ExpressionType != ExpressionTypes.Boolean)
            {
                throw new InvalidSyntax("For loop predicate has to evaluate to a boolean");
            }

            ast.Update.Visit(this);

            ast.Body.Visit(this);

            SetScope(ast);
        }
        private void ForDo(ForLoop forLoop)
        {
            MemorySpaces.CreateScope();

            Exec(forLoop.Setup);

            while (GetValue(Exec(forLoop.Predicate)))
            {
                Exec(forLoop.Update);

                Exec(forLoop.Body);
            }

            MemorySpaces.PopScope();
        }
        public void Visit(ForLoop ast)
        {
            PrintWrap("ForLoop", () =>
                {
                    PrintWrap("For", () => ast.Setup.Visit(this));
                    PrintWrap("Until", () => ast.Predicate.Visit(this));
                    PrintWrap("Modify", () => ast.Update.Visit(this));

                    ast.Body.Visit(this);
                });
        }