darklang / dark

Darklang main repo, including language, backend, and infra
https://darklang.com
Other
1.65k stars 90 forks source link

Tree-sitter-darklang grammar fixes #5400

Closed OceanOak closed 1 month ago

OceanOak commented 1 month ago

No changelog

This PR adds some tree-sitter-darklang grammar tests, and fixes the following issues: Issue 1:

[ ErrorSegment.ErrorSegment.String
    "RTETODO typeChecker.toSegments" ] 

This was parsed as a list of two elements (an enum and a string literal), rather than a list of one element (an enum with one field)

Issue 2:

let x =
  1L
  |> Stdlib.Option.Option.Some
x

The body (x) of the let_expression was parsed as part of the pipe, as if it was a field of the enum.