示例#1
0
		public void Visit(WhileStatement expression)
		{
			Builder.Append("while (");
			expression.Condition.Accept(this);
			Builder.AppendLine(") {");
			indent++;
			Indent();
			expression.Statement.Accept(this);
			indent--;
			Indent();
			Builder.AppendLine("}");
		}
示例#2
0
        public void Visit(WhileStatement statement)
        {
            JsObject scope = new JsObject();
            EnterScope(scope);
            try
            {
                statement.Condition.Accept(this);

                while (Result.ToBoolean())
                {
                    statement.Statement.Accept(this);

                    ResetContinueIfPresent(statement.Label);

                    if (StopStatementFlow())
                    {
                        if (breakStatement != null && statement.Label == breakStatement.Label)
                        {
                            breakStatement = null;
                        }

                        return;
                    }

                    statement.Condition.Accept(this);
                }
            }
            finally
            {
                ExitScope();
            }
        }
示例#3
0
        public void Visit(WhileStatement statement)
        {
            statement.Condition.Accept(this);

            EnsureIdentifierIsDefined(Result);

            while (Result.ToBoolean()) {
                statement.Statement.Accept(this);

                ResetContinueIfPresent(statement.Label);

                if (StopStatementFlow()) {
                    if (breakStatement != null && statement.Label == breakStatement.Label) {
                        breakStatement = null;
                    }

                    return;
                }

                statement.Condition.Accept(this);
            }
        }
示例#4
0
 void Analyze(WhileStatement Stmt)
 {
     SetCurrentLineAndCharNos(Stmt);
     if (Stmt.Condition != null) Analyze(Stmt.Condition);
     if (Stmt.Statement != null) Analyze(Stmt.Statement);
 }