FilterChildren removes all child nodes that do not satisfy the given predicate function.
(pred func(child Token) bool)
| 18 | |
| 19 | // FilterChildren removes all child nodes that do not satisfy the given predicate function. |
| 20 | func (n *Node) FilterChildren(pred func(child Token) bool) { |
| 21 | n.Children = slices.DeleteFunc(n.Children, func(child Token) bool { |
| 22 | return !pred(child) |
| 23 | }) |
| 24 | } |
| 25 | |
| 26 | // ChildNodes returns an iterator over children of type *Node. |
| 27 | func (n *Node) ChildNodes() iter.Seq[*Node] { |
nothing calls this directly
no outgoing calls
no test coverage detected