NAlternative
Represents an alternative block (sequence, cycle, once, pick, shuffle).
Instance Members
mode: AlternativeModeThe alternative mode (sequence, cycle, once, pick, shuffle).
Array of item blocks. Each item is a block of statements.
style: BlockStyleThe block style (indented or braces).
Comments that appear before separator tokens.
type(): String| Returns |
|---|
| String |
each(handleNode: Function): Void| Name | Type |
|---|---|
handleNode |
Function |
toJson(): DynamicConverts the alternative block to a JSON representation.
| Returns | Description |
|---|---|
| Dynamic | Dynamic object containing alternative data |
new(id: NodeId, pos: Position, mode: AlternativeMode, items: Array<NBlock>, ?leadingComments: Array<Comment>, ?trailingComments: Array<Comment>): VoidCreates a new alternative block node.
| Name | Type | Default | Description |
|---|---|---|---|
id |
NodeId | The node ID | |
pos |
Position | Position in source where this alternative appears | |
mode |
AlternativeMode | The alternative mode | |
items |
Array<NBlock> | Array of item blocks | |
leadingComments |
Array<Comment> | (optional) | Optional comments before the alternative |
trailingComments |
Array<Comment> | (optional) | Optional comments after the alternative |