NTernary
Represents a ternary conditional expression (condition ? trueExpr : falseExpr).
Instance Members
condition: NExprThe condition expression.
trueExpr: NExprThe expression to evaluate if the condition is true.
falseExpr: NExprThe expression to evaluate if the condition is false.
type(): String| Returns |
|---|
| String |
each(handleNode: Function): Void| Name | Type |
|---|---|
handleNode |
Function |
toJson(): DynamicConverts the ternary expression to a JSON representation.
| Returns | Description |
|---|---|
| Dynamic | Dynamic object containing ternary data |
new(id: NodeId, pos: Position, condition: NExpr, trueExpr: NExpr, falseExpr: NExpr, ?leadingComments: Array<Comment>, ?trailingComments: Array<Comment>): VoidCreates a new ternary expression node.
| Name | Type | Default | Description |
|---|---|---|---|
id |
NodeId | Node id | |
pos |
Position | Position in source where this expression appears | |
condition |
NExpr | The condition expression | |
trueExpr |
NExpr | Expression evaluated when condition is true | |
falseExpr |
NExpr | Expression evaluated when condition is false | |
leadingComments |
Array<Comment> | (optional) | Optional comments before |
trailingComments |
Array<Comment> | (optional) | Optional comments after the expression |
Metadata
| Name | Parameters |
|---|---|
:hxGen |
- |