for_statement : FOR LPAREN forpre forcond forpost RPAREN forcontent_statement
768414
def p_for_statement(self, p):
        ''
        p[0] = ForStatement(p[3], p[4], p[5], p[7], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
499395
def p_statement_if(p):
    ''''''
    if len(p) == 8:
        p[0] = ast.If(p[3], p[5], p[6], p[7], lineno=p.lineno(1))
    else:
        p[0] = ast.If(p[3], ast.Block(p[6], lineno=p.lineno(5)),
                      p[7], p[8], lineno=p.lineno(1))
1057662
function lastForOf (obj, iterate, context) {
  if (obj) {
    var len, list
    context = context || this
    if (isArray(obj)) {
      for (len = obj.length - 1; len >= 0; len--) {
        if (iterate.call(context, obj[len], len, obj) === false) {
          break
        }
      }
    } else {
      list = objectKeys(obj)
      for (len = list.length - 1; len >= 0; len--) {
        if (iterate.call(context, obj[list[len]], list[len], obj) === false) {
          break
        }
      }
    }
  }
}
1258685
def p_try_statement_1(self, p):
        """"""
        p[0] = self.asttypes.Try(statements=p[2], catch=p[3])
        p[0].setpos(p)
1273794
private void maybeCollapseIntoForStatements(Node n, Node parent) {
    // Only SCRIPT, BLOCK, and LABELs can have FORs that can be collapsed into.
    // LABELs are not supported here.
    if (parent == null || !NodeUtil.isStatementBlock(parent)) {
      return;
    }

    // Is the current node something that can be in a for loop initializer?
    if (!n.isExprResult() && !n.isVar()) {
      return;
    }

    // Is the next statement a valid FOR?
    Node nextSibling = n.getNext();
    if (nextSibling == null) {
      return;
    } else if (nextSibling.isForIn() || nextSibling.isForOf()) {
      Node forNode = nextSibling;
      Node forVar = forNode.getFirstChild();
      if (forVar.isName()
          && n.isVar() && n.hasOneChild()) {
        Node name = n.getFirstChild();
        if (!name.hasChildren()
            && forVar.getString().equals(name.getString())) {
          // OK, the names match, and the var declaration does not have an
          // initializer. Move it into the loop.
          parent.removeChild(n);
          forNode.replaceChild(forVar, n);
          compiler.reportChangeToEnclosingScope(parent);
        }
      }
    } else if (nextSibling.isVanillaFor() && nextSibling.getFirstChild().isEmpty()) {

      // Does the current node contain an in operator?  If so, embedding
      // the expression in a for loop can cause some JavaScript parsers (such
      // as the PlayStation 3's browser based on Access's NetFront
      // browser) to fail to parse the code.
      // See bug 1778863 for details.
      if (NodeUtil.containsType(n, Token.IN)) {
        return;
      }

      // Move the current node into the FOR loop initializer.
      Node forNode = nextSibling;
      Node oldInitializer = forNode.getFirstChild();
      parent.removeChild(n);

      Node newInitializer;
      if (n.isVar()) {
        newInitializer = n;
      } else {
        // Extract the expression from EXPR_RESULT node.
        checkState(n.hasOneChild(), n);
        newInitializer = n.getFirstChild();
        n.removeChild(newInitializer);
      }

      forNode.replaceChild(oldInitializer, newInitializer);

      compiler.reportChangeToEnclosingScope(forNode);
    }
  }
1304495
def p_with_statement(self, p):
        """"""
        p[0] = self.asttypes.With(expr=p[3], statement=p[5])
        p[0].setpos(p)
1285647
def p_iteration_statement_2(self, p):
        """"""
        p[0] = self.asttypes.While(predicate=p[3], statement=p[5])
        p[0].setpos(p)
1148334
def _filter_by_statement(self, statement):
        """"""
        self.__class__._check_conditional_statement(statement, 1)
        _filt_values, _filt_datetimes = [], []
        for i, a in enumerate(self._values):
            if eval(statement, {'a': a}):
                _filt_values.append(a)
                _filt_datetimes.append(self.datetimes[i])
        return _filt_values, _filt_datetimes
387293
def p_statement(self, p):
        
        p[0] = ['statement', p[1][0], p[1][1]]

        if self.options.get('lowercasenames'):
            p[0][1] = p[0][1].lower()

        if (not self.options.get('nostripvalues') and
                not hasattr(p[0][2], 'is_single_quoted') and
                not hasattr(p[0][2], 'is_double_quoted')):
            p[0][2] = p[0][2].rstrip()
200081
private final Statement forStatement(Data data) throws TemplateException {

	int pos = data.srcCode.getPos();

	// id
	String id = variableDec(data, false);
	if (id == null) {
	    data.srcCode.setPos(pos);
	    return null;
	}
	if (id.equalsIgnoreCase("for")) {
	    id = null;
	    data.srcCode.removeSpace();
	    if (!data.srcCode.forwardIfCurrent('(')) {
		data.srcCode.setPos(pos);
		return null;
	    }
	}
	else {
	    data.srcCode.removeSpace();
	    if (!data.srcCode.forwardIfCurrent(':')) {
		data.srcCode.setPos(pos);
		return null;
	    }
	    data.srcCode.removeSpace();

	    if (!data.srcCode.forwardIfCurrent("for", '(')) {
		data.srcCode.setPos(pos);
		return null;
	    }
	}

	Expression left = null;
	Body body = new BodyBase(data.factory);
	Position line = data.srcCode.getPosition();
	comments(data);
	if (!data.srcCode.isCurrent(';')) {
	    // left
	    left = expression(data);
	    comments(data);
	}
	// middle for
	if (data.srcCode.forwardIfCurrent(';')) {

	    Expression cont = null;
	    Expression update = null;
	    // condition
	    comments(data);
	    if (!data.srcCode.isCurrent(';')) {
		cont = condition(data);
		comments(data);
	    }
	    // middle
	    if (!data.srcCode.forwardIfCurrent(';')) throw new TemplateException(data.srcCode, "invalid syntax in for statement");
	    // update
	    comments(data);
	    if (!data.srcCode.isCurrent(')')) {
		update = expression(data);
		comments(data);
	    }
	    // start )
	    if (!data.srcCode.forwardIfCurrent(')')) throw new TemplateException(data.srcCode, "invalid syntax in for statement, for statement must end with a [)]");
	    // ex block
	    Body prior = data.setParent(body);
	    statement(data, body, CTX_FOR);

	    // performance improvment in special constellation
	    // TagLoop loop = asLoop(data.factory,left,cont,update,body,line,data.srcCode.getPosition(),id);
	    // if(loop!=null) return loop;

	    data.setParent(prior);

	    return new For(data.factory, left, cont, update, body, line, data.srcCode.getPosition(), id);
	}
	// middle foreach
	else if (data.srcCode.forwardIfCurrent("in")) {
	    // condition
	    comments(data);
	    Expression value = expression(data);
	    comments(data);
	    if (!data.srcCode.forwardIfCurrent(')')) throw new TemplateException(data.srcCode, "invalid syntax in for statement, for statement must end with a [)]");

	    // ex block
	    Body prior = data.setParent(body);
	    statement(data, body, CTX_FOR);
	    data.setParent(prior);

	    if (!(left instanceof Variable)) throw new TemplateException(data.srcCode, "invalid syntax in for statement, left value is invalid");

	    // if(!(value instanceof Variable))
	    // throw new TemplateException(data.srcCode,"invalid syntax in for statement, right value is
	    // invalid");
	    return new ForEach((Variable) left, value, body, line, data.srcCode.getPosition(), id);
	}
	else throw new TemplateException(data.srcCode, "invalid syntax in for statement");
    }
283847
def p_try_statement_2(self, p):
        """"""
        p[0] = self.asttypes.Try(statements=p[2], fin=p[3])
        p[0].setpos(p)
208490
def p_casecontent_statements(self, p):
        ''
        p[0] = p[1] + (p[2],)
        p.set_lineno(0, p.lineno(1))
1202043
def p_statement_continue(p):
    ''''''
    if len(p) == 3:
        p[0] = ast.Continue(None, lineno=p.lineno(1))
    else:
        p[0] = ast.Continue(p[2], lineno=p.lineno(1))
594683
def p_iteration_statement_6(self, p):
        
        p[0] = ast.ForIn(item=ast.VarDecl(identifier=p[4], initializer=p[5]),
                         iterable=p[7], statement=p[9])
1226910
def p_iteration_statement_1(self, p):
        
        p[0] = self.asttypes.DoWhile(predicate=p[5], statement=p[2])
        p[0].setpos(p)
1221317
def p_while_statement(p):
    ''''''
    if len(p) == 2:
        p[0] = p[1]
    else:
        p[0] = ast.Block(p[2], lineno=p.lineno(1))
1166492
def p_iteration_statement_1(self, p):
        
        p[0] = ast.DoWhile(predicate=p[5], statement=p[2])