Document new DONT_TRAVERSER_CURRENT_AND_CHILDREN constant (#540)

* Document new `DONT_TRAVERSER_CURRENT_AND_CHILDREN` constant

* Rewording sentences, added 1 space indentation to make bullet list correct
This commit is contained in:
Maks Rafalko 2018-10-10 22:56:48 +03:00 committed by Nikita Popov
parent d0230c5c77
commit fb3d89e463
2 changed files with 4 additions and 1 deletions

View File

@ -339,7 +339,8 @@ All four methods can either return the changed node or not return at all (i.e. `
case the current node is not changed.
The `enterNode()` method can additionally return the value `NodeTraverser::DONT_TRAVERSE_CHILDREN`,
which instructs the traverser to skip all children of the current node.
which instructs the traverser to skip all children of the current node. To furthermore prevent subsequent
visitors from visiting the current node, `NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN` can be used instead.
The `leaveNode()` method can additionally return the value `NodeTraverser::REMOVE_NODE`, in which
case the current node will be removed from the parent array. Furthermore it is possible to return

View File

@ -281,6 +281,8 @@ special enterNode/leaveNode return values:
* If *any* visitor returns `DONT_TRAVERSE_CHILDREN`, the children will be skipped for *all*
visitors.
* If *any* visitor returns `DONT_TRAVERSER_CURRENT_AND_CHILDREN`, the children will be skipped for *all*
visitors, and all *subsequent* visitors will not visit the current node.
* If *any* visitor returns `STOP_TRAVERSAL`, traversal is stopped for *all* visitors.
* If a visitor returns a replacement node, subsequent visitors will be passed the replacement node,
not the original one.