Skip to content

Commit 3dc7298

Browse files
committed
Fix indent of case expr matching multiple values
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
1 parent 8410baf commit 3dc7298

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

purescript-indentation.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ autofill-mode."
529529
("rec" . (lambda () (purescript-indentation-with-starter
530530
#'purescript-indentation-expression-layout nil)))
531531
("case" . (lambda () (purescript-indentation-phrase
532-
'(purescript-indentation-expression
532+
`(,(lambda () (purescript-indentation-separated #'purescript-indentation-expression "," nil))
533533
"of" purescript-indentation-case-layout))))
534534
("\\" . (lambda () (purescript-indentation-with-starter
535535
#'purescript-indentation-lambda-maybe-lambdacase nil)))
@@ -713,7 +713,7 @@ autofill-mode."
713713
(end (parse-error "Illegal token: %s" current-token))))))
714714

715715
(defun purescript-indentation-case ()
716-
(purescript-indentation-expression)
716+
(purescript-indentation-separated #'purescript-indentation-expression "," nil)
717717
(cond ((eq current-token 'end-tokens)
718718
(purescript-indentation-add-indentation current-indent))
719719
((string= current-token "|")

0 commit comments

Comments
 (0)