haskell-tree-sitter
haskell-tree-sitter copied to clipboard
Fix tree-sitter-haskell example
tree-sitter-haskell/examples/Demo.hs fails to compile with the following error:
• Couldn't match expected type ‘Node -> TSPoint’
with actual type ‘TSPoint’
• In the pattern: TSPoint {..}
In a pattern binding: TSPoint {..} = nodeStartPoint
In the expression:
do theType <- peekCString nodeType
let TSPoint {..} = nodeStartPoint
start = "(" ++ show pointRow ++ "," ++ show pointColumn ++ ")"
let TSPoint {..} = nodeEndPoint
end = "(" ++ show pointRow ++ "," ++ show pointColumn ++ ")"
print $ theType ++ start ++ "-" ++ end
|
82 | let TSPoint {..} = nodeStartPoint
| ^^^^^^^^^^^^
The problem is tat since 8ae40b366f9a615b58f2a171a801f6cd0fa12325 nodeStartPoint
is not a field but a separate function and requires a Node
as an argument.