@@ -520,7 +520,6 @@ fixes up only indentation."
520
520
(" type" . haskell-indentation-data)
521
521
(" newtype" . haskell-indentation-data)
522
522
(" if" . haskell-indentation-if)
523
- (" case" . haskell-indentation-case)
524
523
(" let" .
525
524
,(apply-partially 'haskell-indentation-phrase
526
525
'(haskell-indentation-declaration-layout
@@ -534,6 +533,10 @@ fixes up only indentation."
534
533
(" rec" .
535
534
,(apply-partially 'haskell-indentation-with-starter
536
535
'haskell-indentation-expression-layout ))
536
+ (" case" .
537
+ ,(apply-partially 'haskell-indentation-phrase
538
+ '(haskell-indentation-expression
539
+ " of" haskell-indentation-case-layout)))
537
540
(" \\ " .
538
541
,(apply-partially 'haskell-indentation-with-starter
539
542
'haskell-indentation-lambda-maybe-lambdacase ))
@@ -574,7 +577,7 @@ fixes up only indentation."
574
577
575
578
(defun haskell-indentation-case-layout ()
576
579
" Parse layout list with case expressions."
577
- (haskell-indentation-layout #'haskell-indentation-case-item ))
580
+ (haskell-indentation-layout #'haskell-indentation-case ))
578
581
579
582
(defun haskell-indentation-lambda-maybe-lambdacase ()
580
583
" Parse lambda or lambda-case expression.
@@ -761,7 +764,7 @@ Skip the keyword or parenthesis." ; FIXME: better description needed
761
764
((equal current-token end)
762
765
(haskell-indentation-read-next-token))))))
763
766
764
- (defun haskell-indentation-case-item- alternative ()
767
+ (defun haskell-indentation-case-alternative ()
765
768
" " ; FIXME
766
769
(setq left-indent (current-column ))
767
770
(haskell-indentation-separated #'haskell-indentation-expression " ," nil )
@@ -772,15 +775,15 @@ Skip the keyword or parenthesis." ; FIXME: better description needed
772
775
; ; otherwise fallthrough
773
776
))
774
777
775
- (defun haskell-indentation-case-item ()
778
+ (defun haskell-indentation-case ()
776
779
" " ; FIXME
777
780
(haskell-indentation-expression)
778
781
(cond ((eq current-token 'end-tokens )
779
782
(haskell-indentation-add-indentation current-indent))
780
783
((string= current-token " |" )
781
784
(haskell-indentation-with-starter
782
785
(apply-partially #'haskell-indentation-separated
783
- #'haskell-indentation-case-item- alternative " |" nil )
786
+ #'haskell-indentation-case-alternative " |" nil )
784
787
nil ))
785
788
((string= current-token " ->" )
786
789
(haskell-indentation-statement-right #'haskell-indentation-expression ))
@@ -957,24 +960,14 @@ layout starts."
957
960
(haskell-indentation-with-starter
958
961
(lambda ()
959
962
(haskell-indentation-separated
960
- #'haskell-indentation-case-item- alternative " |" nil ))
963
+ #'haskell-indentation-case-alternative " |" nil ))
961
964
nil )
962
965
(haskell-indentation-phrase-rest
963
966
'(haskell-indentation-expression
964
967
" then" haskell-indentation-expression
965
968
" else" haskell-indentation-expression))))
966
969
nil ))
967
970
968
- (defun haskell-indentation-case ()
969
- " " ; FIXME
970
- (haskell-indentation-with-starter
971
- (lambda ()
972
- (haskell-indentation-expression)
973
- (when (string= current-token " of" )
974
- (haskell-indentation-with-starter
975
- #'haskell-indentation-case-layout )))
976
- nil ))
977
-
978
971
(defun haskell-indentation-phrase (phrase )
979
972
" " ; FIXME
980
973
(haskell-indentation-with-starter
0 commit comments