You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With GHC 9.0.2, ts_parser_parse_string seems to hang if the parsing fails. Reproduce:
❯ ghci
GHCi, version 9.0.2: https://www.haskell.org/ghc/ :? for help
ghci> import Foreign
ghci> import TreeSitter.Haskell
ghci> import TreeSitter.Parser
ghci> import TreeSitter.Tree
ghci> import Foreign.C
ghci> parser <- ts_parser_new
ghci> _ <- ts_parser_set_language parser tree_sitter_haskell
ghci> (str, len) <- newCStringLen "this hangs everything"
ghci> tree <- ts_parser_parse_string parser nullPtr str len -- This hangs indefinitely
^C^CInterrupted.
The same works if the string is valid tree-sitter's Haskell grammar (including an empty string).
I have tree-sitter-haskell-0.3.0.2, tree-sitter-0.9.0.3 and ghc-9.0.2. If that matters, this is NixOS Linux, and all packages are provided from nixpkgs. The exact environment can be reproduced with NIX_PATH=nixpkgs=https://github.com/nixos/nixpkgs/archive/c5924154f000e6306030300592f4282949b2db6c.tar.gz nix-shell -p 'haskellPackages.ghcWithPackages (ps: with ps; [ tree-sitter tree-sitter-haskell ])' .
I'm not sure how to debug this further.
The text was updated successfully, but these errors were encountered:
I don't know what is the root of the problem but tree-sitter-0.9.0.3 is really outdated and depends on a version of tree-sitter that is more than 2 years old.
I updated dependencies here and now it works without looping forever.
Please see example in this gist.
Or you can git clone https://gist.github.com/e60cd0cb3a14acf28b87f7e5838bcd70.git issue303 and try it.
With GHC 9.0.2,
ts_parser_parse_string
seems to hang if the parsing fails. Reproduce:The same works if the string is valid tree-sitter's Haskell grammar (including an empty string).
I have
tree-sitter-haskell-0.3.0.2
,tree-sitter-0.9.0.3
andghc-9.0.2
. If that matters, this is NixOS Linux, and all packages are provided from nixpkgs. The exact environment can be reproduced withNIX_PATH=nixpkgs=https://github.com/nixos/nixpkgs/archive/c5924154f000e6306030300592f4282949b2db6c.tar.gz nix-shell -p 'haskellPackages.ghcWithPackages (ps: with ps; [ tree-sitter tree-sitter-haskell ])'
.I'm not sure how to debug this further.
The text was updated successfully, but these errors were encountered: