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

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

[nongnu] elpa/haskell-tng-mode 86bcd98 175/385: constraint indentation


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode 86bcd98 175/385: constraint indentation
Date: Tue, 5 Oct 2021 23:59:26 -0400 (EDT)

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

    constraint indentation
---
 haskell-tng-smie.el                   |  4 ++++
 test/src/indentation.hs.append.indent | 14 +++++++-------
 test/src/indentation.hs.insert.indent | 14 +++++++-------
 test/src/indentation.hs.reindent      |  6 +++---
 4 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 751d5fc..a7f396a 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -202,6 +202,9 @@ information, to aid in the creation of new rules."
                      (not (equal prev "}"))))
             "|")
 
+           ((member parent '("::" "=>"))
+            "=>")
+
            ((equal parent "deriving")
             ";")
 
@@ -266,6 +269,7 @@ information, to aid in the creation of new rules."
           (smie-rule-separator method)))
        ((and (or "[" "(" "{") (guard (smie-rule-hanging-p)))
         (smie-rule-parent))
+       ((and "=>" (guard (not (smie-rule-sibling-p)))) 2)
        ("," (if (smie-rule-parent-p "::")
                 ;; types plus record syntax confuse smie-rule-separator. This
                 ;; heuristic works in most cases, but is not robust.
diff --git a/test/src/indentation.hs.append.indent 
b/test/src/indentation.hs.append.indent
index 4218a47..035ccf8 100644
--- a/test/src/indentation.hs.append.indent
+++ b/test/src/indentation.hs.append.indent
@@ -253,7 +253,7 @@ v
 types2 ::
 1    v
      a
-v    1
+2 v  1
   -> b
 v 1  2
   -> c
@@ -263,9 +263,9 @@ v 1  2
 types3 ::
 1    v
      Monad m
-v    1
+2 v  1
   => a
-v 1  2
+1 v  2
   -> b
 v 1  2
   -> c
@@ -273,11 +273,11 @@ v 1  2
 
 v 1  2
 types4 :: Monad m
-v
+1        v
        => (?log :: HasLogger m)
-v      1
+1      v
        => a
-v      1
+1      v
        -> b
 v      1
        -> c
@@ -285,7 +285,7 @@ v      1
 
 v      1
 types5 :: (Monad m, MonadReader Foo m) =>
-1         v
+1        v
           (?log :: HasLogger m) =>
 1         v
           a -> b -> c
diff --git a/test/src/indentation.hs.insert.indent 
b/test/src/indentation.hs.insert.indent
index 34dc432..5ee213d 100644
--- a/test/src/indentation.hs.insert.indent
+++ b/test/src/indentation.hs.insert.indent
@@ -253,7 +253,7 @@ v
 types2 ::
 1    v
      a
-2 1  v
+2 v  1
   -> b
 2 1  v
   -> c
@@ -263,9 +263,9 @@ v 1  2
 types3 ::
 1    v
      Monad m
-3 1  2     v
+2 v  1
   => a
-2 1  v
+1 v  2
   -> b
 2 1  v
   -> c
@@ -273,11 +273,11 @@ v 1  2
 
 v 1  2
 types4 :: Monad m
-2      1        v
+2      1 v
        => (?log :: HasLogger m)
-2      1  v
+1      v
        => a
-2      1  v
+1      v
        -> b
 2      1  v
        -> c
@@ -285,7 +285,7 @@ v      1
 
 v      1
 types5 :: (Monad m, MonadReader Foo m) =>
-1         v
+2        v1
           (?log :: HasLogger m) =>
 1         v
           a -> b -> c
diff --git a/test/src/indentation.hs.reindent b/test/src/indentation.hs.reindent
index 68d3d4b..14fcf7b 100644
--- a/test/src/indentation.hs.reindent
+++ b/test/src/indentation.hs.reindent
@@ -264,7 +264,7 @@ v 2  1
 types3 ::
 2 1  v
      Monad m
-2 1  v
+2 v  1
   => a
 1 v  2
   -> b
@@ -274,7 +274,7 @@ v 1  2
 
 v 2  3 1
 types4 :: Monad m
-2      1  v
+2      1 v
        => (?log :: HasLogger m)
 1      v
        => a
@@ -286,7 +286,7 @@ v      1
 
 v      2  1
 types5 :: (Monad m, MonadReader Foo m) =>
-1         v
+2        v1
           (?log :: HasLogger m) =>
 1         v
           a -> b -> c
\ No newline at end of file



reply via email to

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