tlaplus-community / tree-sitter-tlaplus

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

Jlist should be terminated by treating `|->` as right delimiter #98

Closed ahelwer closed 8 months ago

ahelwer commented 8 months ago

Requires changes to external scanner. This test fails:

===============================|||
Function Literal with Multiple Parameters and Jlist
===============================|||

---- MODULE Test ----
op == [
  x, y \in Nat, <<a, b>> \in
    /\ A
    /\ B
      |->
        /\ A
        /\ B
            ]
====

-------------------------------|||

(source_file (module (header_line) name: (identifier) (header_line)
  (operator_definition name: (identifier) (def_eq)
    definition: (function_literal
      (quantifier_bound intro: (identifier) intro: (identifier) (set_in) set: (nat_number_set))
      (quantifier_bound
        intro: (tuple_of_identifiers (langle_bracket) (identifier) (identifier) (rangle_bracket))
        (set_in)
        set: (conj_list
          (conj_item (bullet_conj) (identifier_ref))
          (conj_item (bullet_conj) (identifier_ref))
        )
      )
      (all_map_to)
      (conj_list
        (conj_item (bullet_conj) (identifier_ref))
        (conj_item (bullet_conj) (identifier_ref))
      )
    )
  )
(double_line)))

Found during work on https://github.com/tlaplus/tlaplus/issues/882