MercuryTechnologies / tree-sitter-haskell-persistent

Persistent grammar for tree-sitter
MIT License
3 stars 1 forks source link

Failure to generate parser with recent tree-sitter #2

Open clason opened 1 month ago

clason commented 1 month ago

Trying to generate the parser with a recent tree-sitter CLI (including the latest 0.22.6) will trigger a panic:

thread 'main' panicked at cli/src/generate/render.rs:259:63:
no entry found for key
stack backtrace:
   0:        0x102cf2f4c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h205eab4daa59a56a
   1:        0x102d15ab8 - core::fmt::write::ha28d0fbf1a1eeba9
   2:        0x102ceeaf8 - std::io::Write::write_fmt::h54f6960924d6c6c0
   3:        0x102cf2da4 - std::sys_common::backtrace::print::hb748761a345859f9
   4:        0x102cf43b4 - std::panicking::default_hook::{{closure}}::h6cb9ca91838de054
   5:        0x102cf4080 - std::panicking::default_hook::h83345dc5126de57b
   6:        0x102cf4c60 - std::panicking::rust_panic_with_hook::h9305dc63490c537b
   7:        0x102cf469c - std::panicking::begin_panic_handler::{{closure}}::h0d6c6c01f5801c1a
   8:        0x102cf33d0 - std::sys_common::backtrace::__rust_end_short_backtrace::h2ace9f7ada66a76a
   9:        0x102cf440c - _rust_begin_unwind
  10:        0x102d50d38 - core::panicking::panic_fmt::hf3031f82c202a80d
  11:        0x102d50d0c - core::option::expect_failed::hadb2936a80a68c9a
  12:        0x102b07608 - tree_sitter_cli::generate::render::Generator::generate::hbf620ef613df9caa
  13:        0x102b0d8c4 - tree_sitter_cli::generate::render::render_c_code::h77f49b2953498b34
  14:        0x102a590a0 - tree_sitter_cli::generate::generate_parser_for_grammar_with_opts::h4e647670d8cef34c
  15:        0x102a587e8 - tree_sitter_cli::generate::generate_parser_in_directory::h29e22d9eecbdd1ef
  16:        0x1029ccd8c - tree_sitter::run::h398dad349a906a4c
  17:        0x1029cbad8 - tree_sitter::main::h157fcfc2c13ebe12
  18:        0x102a07590 - std::sys_common::backtrace::__rust_begin_short_backtrace::hc4e360120bb15e2c
  19:        0x102a075a8 - std::rt::lang_start::{{closure}}::h0154b5d743c1fbc5
  20:        0x102ce7ee4 - std::rt::lang_start_internal::hd3ad173a069f2ae5
  21:        0x1029eb6bc - _main

Strictly speaking this is an upstream tree-sitter bug, but I'd like to raise awareness of this since a) it might be possible to work around this by changing the grammar, and b) if it's not addressed one way or another, this parser will become unusable sooner or later (e.g., with the next ABI bump). Maybe someone more familiar with the grammar can bisect the offending rule (I tried and failed). In case it helps, here's the debug log for tree-sitter generate --no-bindings:

output.log

clason commented 1 month ago

ping @lykahb as this may mean we'll have to drop the language from nvim-treesitter