From beca058e77e9b74230568084173a0554d090d9c2 Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Sun, 13 Sep 2015 22:20:30 +0200 Subject: [PATCH] Keyword do is not open expression This is not syntactically legal Haskell: main = do putStrLn "X" do putStrLn "X" where this is: main = (do putStrLn "X") (do putStrLn "X") It parses but does not type check. --- haskell-indentation.el | 2 +- tests/haskell-indentation-tests.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/haskell-indentation.el b/haskell-indentation.el index 57dab0baf..c95c0020f 100644 --- a/haskell-indentation.el +++ b/haskell-indentation.el @@ -1041,7 +1041,7 @@ parser. If parsing ends here, set indentation to left-indent." (haskell-indentation-add-layout-indent) (throw 'parse-end nil)) ;; after an 'open' expression such as 'if', exit - (unless (member (car parser) '("(" "[" "{" "do" "case")) + (unless (member (car parser) '("(" "[" "{" "case")) (throw 'return nil))))))))) (defun haskell-indentation-test-indentations () diff --git a/tests/haskell-indentation-tests.el b/tests/haskell-indentation-tests.el index 360138da0..9e71cd560 100644 --- a/tests/haskell-indentation-tests.el +++ b/tests/haskell-indentation-tests.el @@ -254,7 +254,7 @@ fun = do { putStrLn \"X\"; }" ((1 0) 0) ((2 0) 9 11) - ((3 0) 0 6)) + ((3 0) 0)) (hindent-test "13* Don't indent after deriving"" data X = X