Skip to content

Commit dd169b4

Browse files
committed
Merge pull request #897 from gracjan/pr-support-where-after-any-expression
Support `where` keyword after any expression
2 parents a7d4b19 + 819de34 commit dd169b4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

haskell-indentation.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,10 @@ parser. If parsing ends here, set indentation to left-indent."
987987
(haskell-indentation-add-indentation current-indent)
988988
(throw 'parse-end nil))
989989
(let ((current-indent (current-column)))
990-
(funcall parser)))
990+
(funcall parser)
991+
(when (equal current-token "where")
992+
(haskell-indentation-with-starter
993+
#'haskell-indentation-expression-layout nil))))
991994

992995
(defun haskell-indentation-guard ()
993996
"Parse \"guard\" statement."

tests/haskell-indentation-tests.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ foo = let
556556
((3 0) 6 9)
557557
((4 0) 4))
558558

559-
(hindent-test "26* should parse unindented where-clause properly" "
559+
(hindent-test "26 should parse unindented where-clause properly" "
560560
foo = do
561561
return ()
562562
where

0 commit comments

Comments
 (0)