AsNode converts the given tree node to a [Node] and [NodeBase], returning nil if that is not possible.
(n tree.Node)
| 108 | // AsNode converts the given tree node to a [Node] and [NodeBase], |
| 109 | // returning nil if that is not possible. |
| 110 | func AsNode(n tree.Node) (Node, *NodeBase) { |
| 111 | ni, ok := n.(Node) |
| 112 | if ok { |
| 113 | return ni, ni.AsNodeBase() |
| 114 | } |
| 115 | return nil, nil |
| 116 | } |
| 117 | |
| 118 | // AsNodeBase returns a generic NodeBase for our node, giving generic |
| 119 | // access to all the base-level data structures without requiring |
no test coverage detected