Finds an "if" expression as a statement
193394
def find_if_expression_as_statement(node):
    """"""
    return (
        isinstance(node, ast.Expr)
        and isinstance(node.value, ast.IfExp)
    )
25020
private final Statement ifStatement(Data data) throws TemplateException {
	if (!data.srcCode.forwardIfCurrent("if", '(')) return null;

	Position line = data.srcCode.getPosition();

	Body body = new BodyBase(data.factory);
	Condition cont = new Condition(data.factory, condition(data), body, line, null);

	if (!data.srcCode.forwardIfCurrent(')')) throw new TemplateException(data.srcCode, "if statement must end with a [)]");
	// ex block
	Body prior = data.setParent(body);
	statement(data, body, CTX_IF);
	data.setParent(prior);
	// else if
	comments(data);
	while (elseifStatement(data, cont)) {
	    comments(data);
	}
	// else
	if (elseStatement(data, cont)) {
	    comments(data);
	}

	cont.setEnd(data.srcCode.getPosition());
	return cont;
    }
1230674
def expr_contains(e, o):
    '''  '''
    if o == e:
        return True
    if e.has_args():
        for a in e.args():
            if expr_contains(a, o):
                return True
    return False
399774
function(a, b){
		
			//Get value for "a" and "b" element
			var aValue = expression(a);
			var bValue = expression(b);
		
			//Check if one element is greater then the second one
			if(aValue < bValue) return -1;
			if(aValue > bValue) return 1;
			return 0;
		}
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))
1169260
def statement(self):
        
        return (self.assignment ^ self.expression) + Suppress(
            self.syntax.terminator)
188329
def p_if_statement_2(self, p):
        """"""
        p[0] = self.asttypes.If(
            predicate=p[3], consequent=p[5], alternative=p[7])
        p[0].setpos(p)
883414
def eval(self, statement, ctxt=None):
        
        self._no_debug = True

        statement = statement.strip()

        if not statement.endswith(";"):
            statement += ";"

        ast = self._parse_string(statement, predefines=False)

        self._dlog("evaluating statement: {}".format(statement))
        
        try:
            res = None
            for child in ast.children():
                res = self._handle_node(child, self._scope, self._ctxt, self._stream)
            return res
        except errors.InterpReturn as e:
            return e.value
        finally:
            self._no_debug = False
1357998
def p_statement_for(p):
    ''
    p[0] = ast.For(p[3], p[5], p[7], p[9], lineno=p.lineno(1))
118132
private boolean checkCondition(TestContext context) {
        if (conditionExpression != null) {
            return conditionExpression.evaluate(context);
        }

        // replace dynamic content with each iteration
        String conditionString = context.replaceDynamicContentInString(condition);
        if (ValidationMatcherUtils.isValidationMatcherExpression(conditionString)) {
            try {
                ValidationMatcherUtils.resolveValidationMatcher("iteratingCondition", "", conditionString, context);
                return true;
            } catch (AssertionError e) {
                return false;
            }
        }

        return BooleanExpressionParser.evaluate(conditionString);
    }
1107876
final public Selector BooleanExpr() throws ParseException {
                           Selector left, right=null;
    left = BooleanTerm();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case OR:
      jj_consume_token(OR);
      right = BooleanExpr();
      break;
    default:
      jj_la1[0] = jj_gen;
      ;
    }
    if (right == null) {if (true) return left;}
    else {if (true) return new OperatorImpl(Operator.OR, left, right);}
    throw new Error("Missing return statement in function");
  }
1137209
def expr(obj, simplify=True):
    """"""
    if isinstance(obj, Expression):
        return obj
    # False, True, 0, 1
    elif isinstance(obj, int) and obj in {0, 1}:
        return _CONSTS[obj]
    elif isinstance(obj, str):
        ast = pyeda.parsing.boolexpr.parse(obj)
        ex = ast2expr(ast)
        if simplify:
            ex = ex.simplify()
        return ex
    else:
        return One if bool(obj) else Zero
1261895
def find(self, text):
        """"""
        for key, value in self:
            if (text in key) or (text in value):
                print(key, value)
886659
public final void statementExpression() throws RecognitionException {
		int statementExpression_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 106) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1111:5: ( expression )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1111:7: expression
			{
			pushFollow(FOLLOW_expression_in_statementExpression4841);
			expression();
			state._fsp--;
			if (state.failed) return;
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 106, statementExpression_StartIndex); }

		}
	}
479197
def visit_ifexp(self, node):
        """"""
        return "%s if %s else %s" % (
            self._precedence_parens(node, node.body, is_left=True),
            self._precedence_parens(node, node.test, is_left=True),
            self._precedence_parens(node, node.orelse, is_left=False),
        )
369191
private static boolean mayBeStatementNoReturn(Node n) {
    switch (n.getToken()) {
      case EMPTY:
      case FUNCTION:
        // EMPTY and FUNCTION are used both in expression and statement
        // contexts
        return true;

      case BLOCK:
      case BREAK:
      case CLASS:
      case CONST:
      case CONTINUE:
      case DEBUGGER:
      case DO:
      case EXPR_RESULT:
      case FOR:
      case FOR_IN:
      case FOR_OF:
      case FOR_AWAIT_OF:
      case IF:
      case LABEL:
      case LET:
      case SWITCH:
      case THROW:
      case TRY:
      case VAR:
      case WHILE:
      case WITH:
        return true;

      default:
        return false;
    }
  }
999751
def in_global_expression(self):
        """"""
        return (self.parenthesis_count == 0 and self.curly_bracket_count == 0
                and self.square_bracket_count == 0
                and not self.in_single_quote and not self.in_double_quote)