tlaplus-community / tree-sitter-tlaplus

A tree-sitter grammar for TLA⁺ and PlusCal
MIT License
57 stars 10 forks source link

Neovim crash when writing set map #60

Closed ahelwer closed 1 year ago

ahelwer commented 2 years ago

Neovim 0.7.2 will crash when writing the following:

set_map == {x + y + z : x, y,

It does not crash if the closing curly brace is typed before typing the generator. Possibly something in the external scanner? Should check whether this also happens in the playground, whether it is unicode-related, etc.

ahelwer commented 2 years ago

It will also crash when writing:

---- MODULE Test ----
func_literal ≜ ∧ [x
====

but not:

---- MODULE Test ----
func_literal == [x
====

lending credence to this being an external scanner issue. Again typing the closing square bracket stops this from happening.

ahelwer commented 1 year ago

As of neovim 0.8.2 this no longer seems to occur.

ahelwer commented 1 year ago

Reopening, occurs with following input even when parsing static file:

---- MODULE Test ----
op == [ ]
THEOREM TRUE
<*> 1
<*> QED
====
ahelwer commented 1 year ago

Another one causing a crash:

---- MODULE Test ----
THEOREM A
  <1> QED BY B
  <1> QED
=====================

Seems best practice to harden the external scanner by checking whether we are in a jlist/proof/pcal block by looking at the relevant stacks, rather than relying on the parser to give us accurate expected symbol information.