emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-tng-mode fdaaf38 148/385: indent after "in"


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode fdaaf38 148/385: indent after "in"
Date: Tue, 5 Oct 2021 23:59:19 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit fdaaf38c3e8f0a805f9759c834b439b98748321e
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>

    indent after "in"
---
 haskell-tng-smie.el                   |  2 +-
 test/haskell-tng-indent-test.el       |  1 -
 test/src/indentation.hs               |  5 +++++
 test/src/indentation.hs.append.indent | 12 +++++++++++-
 test/src/indentation.hs.insert.indent | 12 +++++++++++-
 test/src/indentation.hs.layout        |  7 ++++++-
 test/src/indentation.hs.lexer         |  7 ++++++-
 test/src/indentation.hs.reindent      | 12 +++++++++++-
 test/src/indentation.hs.sexps         |  7 ++++++-
 9 files changed, 57 insertions(+), 8 deletions(-)

diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 1c48b8b..1eaae2d 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -162,7 +162,7 @@ information, to aid in the creation of new rules."
 
     (:after
      (pcase arg
-       ((or "let" "do" "=") 2)
+       ((or "let" "do" "=" "in") 2)
        ("where" (if (smie-rule-parent-p "module") 0 2))
        ))
 
diff --git a/test/haskell-tng-indent-test.el b/test/haskell-tng-indent-test.el
index f04d199..e230359 100644
--- a/test/haskell-tng-indent-test.el
+++ b/test/haskell-tng-indent-test.el
@@ -13,7 +13,6 @@
          "test/haskell-tng-testutils.el")
 
 ;; TODO case statements
-;; TODO let / in
 ;; TODO LambdaCase
 ;; TODO coproduct definitions, the | should align with =
 ;; TODO lists, records, tuples
diff --git a/test/src/indentation.hs b/test/src/indentation.hs
index 3ac38de..4b1e52a 100644
--- a/test/src/indentation.hs
+++ b/test/src/indentation.hs
@@ -40,3 +40,8 @@ nested_where a b = foo a b
       where -- manual correction
         gaz a = blah -- indented
         faz = blah -- same level as gaz
+
+let_in a b = let blah = bloo
+                 wobble _ = fish
+             in
+               flibble blah
diff --git a/test/src/indentation.hs.append.indent 
b/test/src/indentation.hs.append.indent
index 57e8c5b..fdc3540 100644
--- a/test/src/indentation.hs.append.indent
+++ b/test/src/indentation.hs.append.indent
@@ -83,4 +83,14 @@ v
         faz = blah -- same level as gaz
 1   2   v
 
-1   2   v
\ No newline at end of file
+1   2   v
+let_in a b = let blah = bloo
+1                v
+                 wobble _ = fish
+1                v
+             in
+2            1 v 3
+               flibble blah
+v            2 1 3
+
+v            1 2 3
\ No newline at end of file
diff --git a/test/src/indentation.hs.insert.indent 
b/test/src/indentation.hs.insert.indent
index d73738c..a834e52 100644
--- a/test/src/indentation.hs.insert.indent
+++ b/test/src/indentation.hs.insert.indent
@@ -81,4 +81,14 @@ nested_where a b = foo a b
         gaz a = blah -- indented
 1   2   v
         faz = blah -- same level as gaz
-1   2   v
\ No newline at end of file
+1   2   v
+
+2   3   v        1
+let_in a b = let blah = bloo
+1                v
+                 wobble _ = fish
+2            1   v
+             in
+2            1 v 3
+               flibble blah
+v            2 1 3
\ No newline at end of file
diff --git a/test/src/indentation.hs.layout b/test/src/indentation.hs.layout
index 62e1582..6d190ec 100644
--- a/test/src/indentation.hs.layout
+++ b/test/src/indentation.hs.layout
@@ -40,4 +40,9 @@ module Indentation where
       where -- manual correction
         {gaz a = blah -- indented
         ;faz = blah -- same level as gaz
-}}}
\ No newline at end of file
+
+}};let_in a b = let {blah = bloo
+                 ;wobble _ = fish
+             }in
+               flibble blah
+}
\ No newline at end of file
diff --git a/test/src/indentation.hs.lexer b/test/src/indentation.hs.lexer
index ccc3bbb..1fc5ad9 100644
--- a/test/src/indentation.hs.lexer
+++ b/test/src/indentation.hs.lexer
@@ -40,4 +40,9 @@ where
 where
 { VARID VARID = VARID
 ; VARID = VARID
-} } }
+
+} } ; VARID VARID VARID = let { VARID = VARID
+; VARID _ = VARID
+} in
+VARID VARID
+}
diff --git a/test/src/indentation.hs.reindent b/test/src/indentation.hs.reindent
index 27ddfec..e9b782c 100644
--- a/test/src/indentation.hs.reindent
+++ b/test/src/indentation.hs.reindent
@@ -81,4 +81,14 @@ v   1
 1   2   v
         gaz a = blah -- indented
 v   2   1
-        faz = blah -- same level as gaz
\ No newline at end of file
+        faz = blah -- same level as gaz
+2   3   v        1
+
+v   2   3        1
+let_in a b = let blah = bloo
+v            2   1
+                 wobble _ = fish
+v              2 1
+             in
+2            1 v 3
+               flibble blah
\ No newline at end of file
diff --git a/test/src/indentation.hs.sexps b/test/src/indentation.hs.sexps
index b8c3810..e9fc86d 100644
--- a/test/src/indentation.hs.sexps
+++ b/test/src/indentation.hs.sexps
@@ -40,4 +40,9 @@
       (where) -- manual correction
         ((gaz) (a) = (blah) -- indented
         ((faz) = (blah)) -- same level as gaz
-))))))))))
\ No newline at end of file
+
+)))(let_in) (a) (b) = (let ((blah) = (bloo)
+                 ((wobble) (_) = (fish))
+             )in)
+               (flibble) (blah)))))
+)))
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]