Skip to main content

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

ParameterTypeDescription
nodeIFocusableNode | nullThe current position in the AST.
isValid(p1: IFocusableNode | null) => booleanA function true/false depending on whether the given node should be traversed.
loopbooleanWhether to loop around to the beginning of the workspace if no valid node was found.

Returns:

IFocusableNode | null

The next node in the traversal.