NTernary

NodeAstNodeNExprloreline.NTernary (Class)

Represents a ternary conditional expression (condition ? trueExpr : falseExpr).

Instance Members

condition: NExpr

The condition expression.


trueExpr: NExpr

The expression to evaluate if the condition is true.


falseExpr: NExpr

The expression to evaluate if the condition is false.


type(): String
Returns
String

each(handleNode: Function): Void
Name Type
handleNode Function

toJson(): Dynamic

Converts 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>): Void

Creates 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 -