Class ControlConditions

java.lang.Object
org.ek9lang.compiler.support.ControlConditions

public final class ControlConditions extends Object
THE rule for "is this expression a whole CONDITION": the control of an if/else if/switch head, of a while, or the expression of a require or assert.

It stops the flow checks (always true / always false, redundant set and empty checks) reporting on general expressions such as assignments and arguments. Every one of them asks here, so the set of condition positions is extended in one place and E08086, E08088 and E08092 cannot disagree about it (F29, 2026-10-20: it was three byte-identical private copies). A check that also judges the conjuncts of a condition builds on this.

  • Method Details

    • isConditionExpression

      public static boolean isConditionExpression(EK9Parser.ExpressionContext ctx)
      True if the expression, as a whole, is the condition of a control statement, a require or an assert.