haskell-tree-sitter
haskell-tree-sitter copied to clipboard
Optimization: avoid copying startByte and startPoint in Node struct
The TSNode type has cryptic field names, and uses accessor functions for start_byte() and start_point(), but in reality, these two fields correspond directly to fields on the node:
So when loading a node into haskell via the FFI, we can remove the separate startByte and startPoint fields from the Node struct, in order to reduce the amount of data that we copy. This breaks the encapsulation of the TSNode API, but I think that's ok to do in a Tree-sitter binding library.