NewNode creates a new Node for the provided tree-sitter node and a byte-slice containing the JavaScript source. The source provided should be the complete source code and not just the source for the node in question.
(n *sitter.Node, source []byte)
| 32 | // The source provided should be the complete source code |
| 33 | // and not just the source for the node in question. |
| 34 | func NewNode(n *sitter.Node, source []byte) *Node { |
| 35 | return &Node{ |
| 36 | node: n, |
| 37 | source: source, |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | // AsObject returns a Node as jsluice's internal object type, |
| 42 | // to allow the fetching of keys etc |
no outgoing calls