blockly > LineCursor > getNextNode

LineCursor.getNextNode() method

Get the next node in the AST, optionally allowing for loopback.

Signature:

getNextNode(node: IFocusableNode | null, isValid: (p1: IFocusableNode | null) => boolean, loop: boolean): IFocusableNode | null;

Parameters

Parameter Type Description
node IFocusableNode | null The current position in the AST.
isValid (p1: IFocusableNode | null) => boolean A function true/false depending on whether the given node should be traversed.
loop boolean Whether to loop around to the beginning of the workspace if no valid node was found.

Returns:

IFocusableNode | null

The next node in the traversal.