Constructor
new LoopNode( params : Array.<(LoopNode~Params|loopBodyCallback)> )
Constructs a new loop node.
| params |
Any number of loop parameters followed by the loop body. |
Methods
.getProperties( builder : NodeBuilder ) : Object
Returns properties about this node.
| builder |
The current node builder. |
- Returns: The node properties.
.getVarName( index : number ) : string
Returns a loop variable name based on an index. The pattern is
0 = i, 1= j, 2= k and so on.
| index |
The index. |
- Returns: The loop variable name.
Type Definitions
.ObjectParams
A detailed loop configuration.
|
start
number | Node.<int> | Node.<uint> |
The initial value of the loop variable. Default is |
|
end
number | Node.<int> | Node.<uint> |
The value the loop variable is compared against. If omitted, the loop counts down from |
|
name
string |
The name of the loop variable. Defaults to |
|
type
string |
The data type of the loop variable. Default is |
|
condition
'<' | '<=' | '>' | '>=' |
The comparison operator. The loop runs as long as the comparison is true. Inferred from |
|
update
string | number | function | Node |
Defines how the loop variable is updated after each iteration. Inferred from |
.Params
The parameters of a loop. A number or int/uint node defines the loop's end value,
a bool node defines a while loop and an object allows a more detailed configuration.