Implements @if and @else if
167492
def _do_if(self, rule, p_selectors, p_parents, p_children, scope, media, c_lineno, c_property, c_codestr, code, name):
        
        if code != '@if':
            if '@if' not in rule[OPTIONS]:
                log.error("@else with no @if (%s)", rule[INDEX][rule[LINENO]])
            val = not rule[OPTIONS].get('@if', True)
            name = c_property[9:].strip()
        else:
            val = True
        if val:
            val = self.calculate(name, rule[CONTEXT], rule[OPTIONS], rule)
            val = bool(False if not val or val in('0', 'false',) or (isinstance(
                val, basestring) and _variable_re.match(val)) else val)
            if val:
                rule[CODESTR] = c_codestr
                self.manage_children(
                    rule, p_selectors, p_parents, p_children, scope, media)
            rule[OPTIONS]['@if'] = val
558136
private final boolean elseifStatement(Data data, Condition cont) throws TemplateException {
	int pos = data.srcCode.getPos();
	if (!data.srcCode.forwardIfCurrent("else")) return false;

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

	Position line = data.srcCode.getPosition();
	Body body = new BodyBase(data.factory);
	Pair pair = cont.addElseIf(condition(data), body, line, null);

	if (!data.srcCode.forwardIfCurrent(')')) throw new TemplateException(data.srcCode, "else if statement must end with a [)]");
	// ex block
	Body prior = data.setParent(body);
	statement(data, body, CTX_ELSE_IF);
	data.setParent(prior);

	pair.end = data.srcCode.getPosition();
	return true;
    }
1096042
def method_missing(name, *args)
      name = name.to_s
      last_char = name[-1,1]
      super(name, *args) unless last_char == "=" || last_char == "?"
      attr_name = name[0..-2].to_sym # :foo for 'foo=' or 'foo?'
      if last_char == "="
        @options[attr_name] = args.at(0)
      else
        @options[attr_name]
      end
    end
1279193
def _do_if_else_condition(self, condition):
        
        self.save()
        d = self.dispatch_table
        if condition:
            self.start_handling_includes()
            d['elif'] = self.stop_handling_includes
            d['else'] = self.stop_handling_includes
        else:
            self.stop_handling_includes()
            d['elif'] = self.do_elif
            d['else'] = self.start_handling_includes
1153304
public final void mELSE() throws RecognitionException {
		try {
			int _type = ELSE;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:22:6: ( 'else' )
			// hql.g:22:8: 'else'
			{
			match("else"); if (state.failed) return;

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
1118999
def evaluate(self, parameters):
        """"""
        if self.match(parameters):
            if isinstance(self.then, ParameterCondition):
                #recursive parametercondition
                return self.then.evaluate(parameters)
            else:
                return self.then
        elif self.otherwise:
            if isinstance(self.otherwise, ParameterCondition):
                #recursive else
                return self.otherwise.evaluate(parameters)
            else:
                return self.otherwise
        return False
1078664
private boolean evaluateConditional(Siren4JCondition condition, EntityContext context) {
        boolean result = true;
        if (condition != null && !("null".equals(condition.name()))) {
            result = false;
            Object val = null;
            ConditionFactory factory = ConditionFactory.getInstance();
            Condition cond = factory.getCondition(condition.logic());
            Object obj = condition.name().startsWith("parent.")
                    ? context.getParentObject()
                    : context.getCurrentObject();
            String name = condition.name().startsWith("parent.")
                    ? condition.name().substring(7)
                    : condition.name();
            if (obj == null) {
                throw new Siren4JRuntimeException(
                        "No object found. Conditional probably references a parent but does not have a parent: " + condition
                                .name());
            }
            if (condition.type().equals(Type.METHOD)) {
                try {
                    Method method = ReflectionUtils.findMethod(obj.getClass(), name,
                            null);
                    if (method != null) {
                        method.setAccessible(true);
                        val = method.invoke(obj, new Object[]{});
                        result = cond.evaluate(val);
                    } else {
                        throw new Siren4JException(
                                "Method referenced in condition does not exist: " + condition.name());
                    }
                } catch (Exception e) {
                    throw new Siren4JRuntimeException(e);
                }
            } else {
                try {
                    Field field = ReflectionUtils.findField(obj.getClass(), name);
                    if (field != null) {
                        field.setAccessible(true);
                        val = field.get(obj);
                        result = cond.evaluate(val);
                    } else {
                        throw new Siren4JException("Field referenced in condition does not exist: " + condition.name());
                    }
                } catch (Exception e) {
                    throw new Siren4JRuntimeException(e);
                }
            }
        }
        return result;
    }
447108
def assign( value )
      if @value.respond_to? :assign
        @value.assign value.simplify.get
      else
        @value = value.simplify.get
      end
      value
    end
1025909
public static void check(final boolean condition, final String message, final Object... args) {
        if (!condition) {
            throw new MethodDefinitionException(String.format(message, args));
        }
    }
1100360
public function ifX(AbstractOperator $condition = null, StatementsBlock $statements = null, StatementsBlock $elseStatements = null)
    {
        return new IfStatement($condition, $statements, $elseStatements);
    }
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);
    }
602628
def p_If(p):
    '''
    
    '''
    if len(p) == 2:
        p[0] = If(p[1], None, None)
    else:
        p[0] = If(p[1], p[5], p[4])
500666
private static void checkPreconditions(final Class<?> jodaClass,
			final String pattern) {
		if (jodaClass == null) {
			throw new NullPointerException("jodaClass should not be null");
		} else if (pattern == null) {
			throw new NullPointerException("pattern should not be null");
		}
	}
1187190
public void check(Declaration decl, AnnotationProcessorEnvironment env) {

        _locale = Locale.getDefault();

        if (decl instanceof TypeDeclaration) {

            //
            // Check method annotations
            //
            Collection<? extends MethodDeclaration> methods = ((TypeDeclaration) decl).getMethods();
            for (MethodDeclaration method : methods) {
                checkSQL(method, env);

            }
        } else if (decl instanceof FieldDeclaration) {

            //
            // NOOP
            //
        } else {

            //
            // NOOP
            //
        }
    }
620247
def p_ifdef_else_a(p):
    
    global ENABLED

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

    ENABLED = not ENABLED
200943
function checkConditional(runner, conditional) {
  try {
    return conditional[1].call(runner, runner.target, runner.context);
  } catch (e) {}
}
409749
public static <T> T check(T value, T elseValue, boolean res) {
        return res ? value : elseValue;
    }