TernaryOpertaor

- Added new `Expression`-based type
This commit is contained in:
Tristan B. Velloza Kildaire 2024-05-05 13:43:54 +02:00
parent 8561cdb1b9
commit 2a7b68600d
1 changed files with 33 additions and 0 deletions

View File

@ -380,4 +380,37 @@ public final class ArrayIndex : Expression
{
return "ArrayIndex [to: "~indexInto.toString()~", idx: "~index.toString()~"]";
}
}
public final class TernaryOperator : Expression
{
private Expression condition;
private Expression whenTrue, whenFalse;
this
(
Expression condition,
Expression whenTrue,
Expression whenFalse
)
{
this.condition = condition;
this.whenTrue = whenTrue;
this.whenFalse = whenFalse;
}
public Expression getCondition()
{
return this.condition;
}
public Expression getTrueExpression()
{
return this.whenTrue;
}
public Expression getFalseExpression()
{
return this.whenFalse;
}
}