22#define PM_NODE_LIST_FOREACH(list, index, node) \
23 for (size_t index = 0; index < (list)->size && ((node) = (list)->nodes[index]); index++)
#define PRISM_EXPORTED_FUNCTION
By default, we compile with -fvisibility=hidden.
#define PRISM_NONNULL(...)
Mark the parameters of a function as non-null.
PRISM_EXPORTED_FUNCTION void pm_node_list_append(pm_arena_t *arena, pm_node_list_t *list, pm_node_t *node) PRISM_NONNULL(1
Append a node to the end of a node list.
pm_visit_result_t(* pm_visit_callback_t)(const pm_node_t *node, void *data)
A callback that is called for each node visited by pm_visit_node and pm_visit_child_nodes.
PRISM_EXPORTED_FUNCTION bool pm_visit_node(const pm_node_t *node, pm_visit_callback_t visitor, void *data) PRISM_NONNULL(1)
Visit each of the nodes in this subtree using the given visitor callback.
pm_visit_result_t
The value returned by a visitor callback, which determines where the walk goes next.
@ PM_VISIT_SKIP
Continue the walk without visiting this node's children.
@ PM_VISIT_STOP
End the walk without visiting any more nodes.
@ PM_VISIT_DESCEND
Continue the walk by visiting this node's children.
PRISM_EXPORTED_FUNCTION bool pm_visit_child_nodes(const pm_node_t *node, pm_visit_callback_t visitor, void *data) PRISM_NONNULL(1)
Visit the children of the given node with the given callback.
A list of nodes in the source, most often used for lists of children.
This is the base structure that represents a node in the syntax tree.