if_stmt : IF expr sep stmt_list_opt elseif_stmt END_STMT
            | IF LPAREN expr RPAREN stmt_list_opt elseif_stmt END_STMT
435973
def p_if_stmt(p):
    
    if len(p) == 7:
        p[0] = node.if_stmt(cond_expr=p[2], then_stmt=p[4], else_stmt=p[5])
    elif len(p) == 8:
        p[0] = node.if_stmt(cond_expr=p[3], then_stmt=p[5], else_stmt=p[6])
    else:
        assert 0
19919
def p_case_list(p):
    
    if len(p) == 1:
        p[0] = node.stmt_list()
    elif len(p) == 3:
        assert isinstance(p[2], node.stmt_list)
        p[0] = p[2]
    elif len(p) == 6:
        p[0] = node.if_stmt(
            cond_expr=node.expr(
                op="==", args=node.expr_list([p[2]])),
            then_stmt=p[4],
            else_stmt=p[5])
        p[0].cond_expr.args.append(
            None)  # None will be replaced using backpatch()
    else:
        assert 0
186780
def p_statements_statement(p):
    
    if len(p) == 2:
        p[0] = make_block(p[1])
    else:
        p[0] = make_block(p[1], p[2])
620247
def p_ifdef_else_a(p):
    
    global ENABLED

    if ENABLED:
        p[0] = [p[2]] + p[3]
    else:
        p[0] = []

    ENABLED = not ENABLED
802825
private void processElseIfCmd(String parms, int cmdTPosBegin, int cmdTPosEnd)
            throws MiniTemplator.TemplateSyntaxException {
        excludeTemplateRange(cmdTPosBegin, cmdTPosEnd);
        if (condLevel < 0) {
            throw new MiniTemplator.TemplateSyntaxException("$elseIf without matching $if.");
        }
        boolean enabled = isCondEnabled(condLevel - 1) && !condPassed[condLevel] && evaluateConditionFlags(parms);
        condEnabled[condLevel] = enabled;
        if (enabled) {
            condPassed[condLevel] = true;
        }
    }
796450
def make_if_statement(instr, queue, stack, context):
    
    test_expr = make_expr(stack)
    if isinstance(instr, instrs.POP_JUMP_IF_TRUE):
        test_expr = ast.UnaryOp(op=ast.Not(), operand=test_expr)

    first_block = popwhile(op.is_not(instr.arg), queue, side='left')
    if isinstance(first_block[-1], instrs.RETURN_VALUE):
        body = instrs_to_body(first_block, context)
        return ast.If(test=test_expr, body=body, orelse=[])

    jump_to_end = expect(
        first_block.pop(), instrs.JUMP_FORWARD, "at end of if-block"
    )

    body = instrs_to_body(first_block, context)

    # First instruction after the whole if-block.
    end = jump_to_end.arg
    if instr.arg is jump_to_end.arg:
        orelse = []
    else:
        orelse = instrs_to_body(
            popwhile(op.is_not(end), queue, side='left'),
            context,
        )

    return ast.If(test=test_expr, body=body, orelse=orelse)
356303
def p_end(p):
    
    q = make_number(0, lineno=p.lineno(1)) if len(p) == 2 else p[2]
    p[0] = make_sentence('END', q)
285216
def p_ifdef_else_b(p):
    
    global ENABLED

    if ENABLED:
        p[0] = ['#line %i "%s"%s' % (p.lineno(1) + 1, CURRENT_FILE[-1], p[2])]
        p[0] += p[3]
    else:
        p[0] = []
456073
def refactor_ifs(stmnt, ifs):
    '''
    
    '''
    if isinstance(stmnt, _ast.BoolOp):
        test, right = stmnt.values
        if isinstance(stmnt.op, _ast.Or):
            test = _ast.UnaryOp(op=_ast.Not(), operand=test, lineno=0, col_offset=0)

        ifs.append(test)

        return refactor_ifs(right, ifs)
    return stmnt
1336268
def p_elseif_list(p):
    ''''''
    if len(p) == 2:
        p[0] = []
    else:
        p[0] = p[1] + [ast.ElseIf(p[4], p[6], lineno=p.lineno(2))]
65624
def p_foo_stmt(p):
    ""
    expr1 = p[1][1][0]
    expr2 = p[3][1][0]
    ident = expr1.ret
    args1 = expr1.args
    args2 = expr2.args
    p[0] = node.let(ret=ident,
                    args=node.expr("or", node.expr_list([args1, args2])))
349241
public function pStmt_ElseIf(Stmt\ElseIf_ $node)
    {
        return sprintf(
            " %s (%s) %s%s\n%s",
            $this->color('elseif', SyntaxHighlighterConfig::TYPE_KEYWORD),
            $this->p($node->cond),
            $this->color('{', SyntaxHighlighterConfig::TYPE_BRACE),
            $this->pStmts($node->stmts),
            $this->color('}', SyntaxHighlighterConfig::TYPE_BRACE)
        );
    }
288548
private Context translateIf(WyilFile.Stmt.IfElse stmt, Context context) {
		//
		Pair<Expr, Context> p = translateExpressionWithChecks(stmt.getCondition(), null, context);
		Expr trueCondition = p.first();
		// FIXME: this is broken as includes assumptions propagated through
		// logical &&'s
		context = p.second();
		Expr falseCondition = invertCondition(trueCondition, stmt.getCondition());
		//
		Context trueContext = context.assume(trueCondition);
		Context falseContext = context.assume(falseCondition);
		//
		trueContext = translateStatementBlock(stmt.getTrueBranch(), trueContext);
		if (stmt.hasFalseBranch()) {
			falseContext = translateStatementBlock(stmt.getFalseBranch(), falseContext);
		}
		// Finally, we must join the two context's back together. This ensures
		// that information from either side is properly preserved
		return joinDescendants(context, new Context[] { trueContext, falseContext });
	}
211777
def p_for_statement(p):
    ''''''
    if len(p) == 2:
        p[0] = p[1]
    else:
        p[0] = ast.Block(p[2], lineno=p.lineno(1))
119894
def visit_IfExp(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        with self.op_man(node):
            src = " if ".join((self.visit(node.body, dfltChaining=False),
                               " else ".join((self.visit(node.test),
                                              self.visit(node.orelse)))))
            return self.wrap_expr(src, dfltChaining)
483863
def where_stmt_handle(tokens):
    """"""
    internal_assert(len(tokens) == 2, "invalid where statement tokens", tokens)
    base_stmt, assignment_stmts = tokens
    stmts = list(assignment_stmts) + [base_stmt]
    return "\n".join(stmts) + "\n"
157801
Expr or() {
		Expr expr = and();
		for (Tok tok=peek(); tok.sym==Sym.OR; tok=peek()) {
			move();
			expr = new Logic(Sym.OR, expr, and(), location);
		}
		return expr;
	}