mirror of https://github.com/tbklang/tlang.git
parent
8561cdb1b9
commit
2a7b68600d
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue