Class CoalescingOperandParenthesesOrError
java.lang.Object
org.ek9lang.compiler.phase1.CoalescingOperandParenthesesOrError
- All Implemented Interfaces:
Consumer<EK9Parser.ExpressionContext>
final class CoalescingOperandParenthesesOrError
extends Object
implements Consumer<EK9Parser.ExpressionContext>
E08269 (Steve, D6, 2026-10-07): a coalescing operator - the null coalescing
??, the Elvis ?:
and the comparison coalescing family <? <=? >? >=? - may not be an UNPARENTHESISED operand of a
DIFFERENT binary operator, nor take one as an operand.
These operators share ONE level that binds tighter than arithmetic, comparison and logic (PRECEDENCE (5),
2026-10-07), so a + b ?: c is
a + (b ?: c): when a is unset the whole result is unset and the fallback was never
a fallback for the sum. Rather than document a precedence nobody guesses, the mix is a compile
error and the parentheses say which reading is meant. A chain of the SAME operator
(a ?: b ?: c, a ?? b ?? c, a <? b <? c) reads one way only and stays legal.
?? joined the rule on 2026-10-07 (P3): a ?? b ^ c had changed reading silently when the
coalescing level moved below ^.
Purely syntactic, so it runs in phase 1 over the parse tree (see BinaryExpressions).
-
Constructor Details
-
CoalescingOperandParenthesesOrError
CoalescingOperandParenthesesOrError(ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<EK9Parser.ExpressionContext>
-