Skip to content

Commit

Permalink
add safety comments in NodeVisitor.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
mkscrg committed Jun 28, 2023
1 parent 1143cfc commit 8cfe30a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/NodeVisitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Foundation
*/
public protocol NodeVisitor {
/**
* Callback for when a node is first visited.
* Callback for when a node is first visited. {@code head} cannot safely call {@code node.remove()}.
*
* @param node the node being visited.
* @param depth the depth of the node, relative to the root node. E.g., the root node has depth 0, and a child node
Expand All @@ -27,7 +27,7 @@ public protocol NodeVisitor {
func head(_ node: Node, _ depth: Int)throws

/**
* Callback for when a node is last visited, after all of its descendants have been visited.
* Callback for when a node is last visited, after all of its descendants have been visited. {@code tail} can safely call {@code node.remove()}.
*
* @param node the node being visited.
* @param depth the depth of the node, relative to the root node. E.g., the root node has depth 0, and a child node
Expand Down

0 comments on commit 8cfe30a

Please sign in to comment.