gleam-lang / tree-sitter-gleam

🌳 A tree-sitter grammar for the Gleam programming language
Apache License 2.0
66 stars 13 forks source link

Parser changes #51

Closed lpil closed 1 year ago

lpil commented 1 year ago

Hello there!

Gleam's parser has been changed to only permit let and use directly within functions and block. Code such as this will now be rejected:

let x = let y = 1

This is a subset of the previously accepted syntax so the current tree sitter will still parse all valid programs, but perhaps perhaps it wants to be restricted also?

the-mikedavis commented 1 year ago

I think tree-sitter parsers shouldn't be so restrictive that they are basically linters but on the other hand it's a nice experience when your syntax highlighting hints that your program will not compile. So I think we should stay close to the upstream parser here and restrict this syntax 👍

J3RN commented 1 year ago

Agreed