tree-sitter / tree-sitter-haskell

Haskell grammar for tree-sitter.
MIT License
152 stars 36 forks source link

Grammar does not fully support -XBlockArguments extension #22

Closed patrickt closed 3 years ago

patrickt commented 5 years ago

GHC 8.6 comes with an extension, “block arguments”, that entails a drastic change to the parser. You can find the change specification here, but the tl;dr is that you can now often omit parentheses and $ invocations associated with do blocks:

local f do
  thing1
  thing2

rather than

local f $ do
  thing1
  thing2

This has drastic effects on the grammar—in the words of the proposal author:

Unless a special care is taken, an implementation will add a large number of shift-reduce conflicts to the parser, due to the reliance on the meta-rule mentioned above

This is a nontrivial change, but it’s one we should ultimately make.

patrickt commented 3 years ago

This is fixed.

tek commented 3 years ago

nope, let and if are still missing!

patrickt commented 3 years ago

Oops! Good catch.

tek commented 3 years ago

now it's fixed :sweat_smile: