purescript-emacs / purescript-mode

Emacs major mode and related tools for Purescript
20 stars 10 forks source link

Fix indent of case expr matching multiple values #11

Closed axelf4 closed 1 year ago

axelf4 commented 3 years ago

Makes parsing not fail for case expressions that match multiple expressions at once, such as

case a, b of
  Just 1, Just 1 -> 1
  _, _ -> 0

This syntax was added in PureScript v0.8.0.

See: https://github.com/purescript/documentation/blob/master/language/Syntax.md#case-expressions

gomain commented 3 years ago

Why is this not merged? Is it pending for review?

gomain commented 3 years ago

I can't get this to work. Still Parse error when press tab on multi value match expression. Any suggestions?

axelf4 commented 3 years ago

I can't get this to work. Still Parse error when press tab on multi value match expression. Any suggestions?

Could you give a MWE? My guess is that you are running into some other issue. For example, record literals interact poorly with explicit layout.

gomain commented 3 years ago

My guess is that you are running into some other issue. For example, record literals interact poorly with explicit layout.

You're right. It's this

test a
  = let { b } = a
     in b -- parse error since here

Multi match case work fine. Submitted #12.

Thank you for your patch.

kritzcreek commented 1 year ago

Thank you, sorry for the long wait.