NChoiceOption

NodeAstNodeloreline.NChoiceOption (Class)

Represents a single option within a choice statement.

Instance Members

The text displayed for this option.


insertion: NInsertion

Alternatively, instead of text, this could be an insertion


condition: Null<NExpr>

Optional condition that must be true for this option to be available.


conditionStyle: ConditionStyle

The style of the condition (plain or parentheses).


Array of nodes to execute when this option is chosen.


The block style of the body


type(): String
Returns
String

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

toJson(): Dynamic

Converts the choice option to a JSON representation.

Returns Description
Dynamic Dynamic object containing option data

new(id: NodeId, pos: Position, text: NStringLiteral, insertion: NInsertion, condition: Null<NExpr>, conditionStyle: ConditionStyle, body: Array<AstNode>, ?leadingComments: Array<Comment>, ?trailingComments: Array<Comment>): Void

Creates a new choice option node.

Name Type Default Description
id NodeId
pos Position Position in source where this option appears
text NStringLiteral String literal containing the option text
insertion NInsertion
condition Null<NExpr> Optional condition for option availability
conditionStyle ConditionStyle The style of the condition (plain or parentheses)
body Array<AstNode> Array of nodes to execute when chosen
leadingComments Array<Comment> (optional) Optional comments before the option
trailingComments Array<Comment> (optional) Optional comments after the option

Metadata

Name Parameters
:hxGen -