[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 7f9afd2 159/385: list indentation
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 7f9afd2 159/385: list indentation |
Date: |
Tue, 5 Oct 2021 23:59:22 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 7f9afd2ac131c770f4dc98739448e5302d1c39cc
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
list indentation
---
haskell-tng-smie.el | 7 +++++++
test/haskell-tng-indent-test.el | 1 -
test/src/indentation.hs | 15 +++++++++++++++
test/src/indentation.hs.append.indent | 32 +++++++++++++++++++++++++++++++-
test/src/indentation.hs.insert.indent | 32 +++++++++++++++++++++++++++++++-
test/src/indentation.hs.layout | 15 +++++++++++++++
test/src/indentation.hs.lexer | 15 +++++++++++++++
test/src/indentation.hs.reindent | 32 +++++++++++++++++++++++++++++++-
test/src/indentation.hs.sexps | 17 ++++++++++++++++-
test/src/indentation.hs.syntax | 15 +++++++++++++++
10 files changed, 176 insertions(+), 5 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 9ffc506..267d63b 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -177,6 +177,8 @@ information, to aid in the creation of new rules."
parent grand)))))
(cond
+ ((smie-rule-parent-p "[") ",")
+
((or (smie-rule-parent-p "|")
(and (smie-rule-parent-p "=")
(smie-rule-grandparent-p "data"))
@@ -211,6 +213,8 @@ information, to aid in the creation of new rules."
((or "let" "do" "of" "=" "in" "->" "\\") 2)
("\\case" 2) ;; LambdaCase
("where" (if (smie-rule-parent-p "module") 0 2))
+ ("[" 2)
+ ("," (smie-rule-separator method))
((or "$" "SYMID")
(if (smie-rule-hanging-p) 2 (smie-rule-parent)))
))
@@ -236,6 +240,9 @@ information, to aid in the creation of new rules."
(if (smie-rule-parent-p "=")
(smie-rule-parent-column)
(smie-rule-separator method)))
+ ("[" (when (smie-rule-hanging-p)
+ (smie-rule-parent)))
+ ("," (smie-rule-separator method))
(_ (when (smie-rule-parent-p "$" "SYMID")
(smie-rule-parent)))
))
diff --git a/test/haskell-tng-indent-test.el b/test/haskell-tng-indent-test.el
index e1caec8..23ea996 100644
--- a/test/haskell-tng-indent-test.el
+++ b/test/haskell-tng-indent-test.el
@@ -14,7 +14,6 @@
;; FIXME implement more indentation rules
;;
-;; TODO lists
;; TODO tuples
;; TODO records
;; TODO multiline type signatures
diff --git a/test/src/indentation.hs b/test/src/indentation.hs
index 2b0db4e..3bccfb8 100644
--- a/test/src/indentation.hs
+++ b/test/src/indentation.hs
@@ -76,3 +76,18 @@ not_dollars = do
data Wibble = Wibble Int
| Wobble Int
| Vibble Int
+
+lists1 = [ foo
+ , bar
+ , [ blah
+ , blah
+ , blah ]
+ ]
+
+lists2 = [
+ foo
+, bar
+]
+
+lists3 = [ foo ,
+ bar ]
diff --git a/test/src/indentation.hs.append.indent
b/test/src/indentation.hs.append.indent
index 1392bd9..00c2ade 100644
--- a/test/src/indentation.hs.append.indent
+++ b/test/src/indentation.hs.append.indent
@@ -155,4 +155,34 @@ v
| Vibble Int
1 v
-v 1
\ No newline at end of file
+v 1
+lists1 = [ foo
+1 v
+ , bar
+1 v
+ , [ blah
+2 1 v
+ , blah
+1 2 v
+ , blah ]
+2 v 1
+ ]
+v 1 2
+
+v 1 2
+lists2 = [
+1 v
+ foo
+v 1
+, bar
+v
+]
+v
+
+v
+lists3 = [ foo ,
+1 v
+ bar ]
+v 1
+
+v 1
\ No newline at end of file
diff --git a/test/src/indentation.hs.insert.indent
b/test/src/indentation.hs.insert.indent
index f7eedd9..b107c08 100644
--- a/test/src/indentation.hs.insert.indent
+++ b/test/src/indentation.hs.insert.indent
@@ -153,4 +153,34 @@ data Wibble = Wibble Int
| Wobble Int
1 v
| Vibble Int
-v 1
\ No newline at end of file
+1 v
+
+v 1
+lists1 = [ foo
+1 v
+ , bar
+2 1 v
+ , [ blah
+2 1 v
+ , blah
+2 3 1 v
+ , blah ]
+2 1 v
+ ]
+v 1 2
+
+v 1 2
+lists2 = [
+1 v
+ foo
+1 v
+, bar
+v
+]
+v
+
+v
+lists3 = [ foo ,
+1 v
+ bar ]
+v 1
\ No newline at end of file
diff --git a/test/src/indentation.hs.layout b/test/src/indentation.hs.layout
index b7767cd..3befa99 100644
--- a/test/src/indentation.hs.layout
+++ b/test/src/indentation.hs.layout
@@ -76,4 +76,19 @@ module Indentation where
};data Wibble = Wibble Int
| Wobble Int
| Vibble Int
+
+;lists1 = [ foo
+ , bar
+ , [ blah
+ , blah
+ , blah ]
+ ]
+
+;lists2 = [
+ foo
+;, bar
+;]
+
+;lists3 = [ foo ,
+ bar ]
}
\ No newline at end of file
diff --git a/test/src/indentation.hs.lexer b/test/src/indentation.hs.lexer
index 5ff22ed..cf7d432 100644
--- a/test/src/indentation.hs.lexer
+++ b/test/src/indentation.hs.lexer
@@ -76,4 +76,19 @@ VARID
} ; data CONID = CONID CONID
| CONID CONID
| CONID CONID
+
+; VARID = « VARID
+, VARID
+, « VARID
+, VARID
+, VARID »
+»
+
+; VARID = «
+VARID
+; , VARID
+; »
+
+; VARID = « VARID ,
+VARID »
}
diff --git a/test/src/indentation.hs.reindent b/test/src/indentation.hs.reindent
index b6181e0..70540ec 100644
--- a/test/src/indentation.hs.reindent
+++ b/test/src/indentation.hs.reindent
@@ -153,4 +153,34 @@ data Wibble = Wibble Int
1 v
| Wobble Int
1 v
- | Vibble Int
\ No newline at end of file
+ | Vibble Int
+v 1
+
+v 1 2
+lists1 = [ foo
+1 v
+ , bar
+2 v 1
+ , [ blah
+2 1 v
+ , blah
+2 1 v
+ , blah ]
+2 v 1
+ ]
+v 1 2
+
+v 1 2 3
+lists2 = [
+1 v
+ foo
+v 1
+, bar
+v
+]
+v
+
+v 1
+lists3 = [ foo ,
+1 v
+ bar ]
\ No newline at end of file
diff --git a/test/src/indentation.hs.sexps b/test/src/indentation.hs.sexps
index 32ad8d7..16a638a 100644
--- a/test/src/indentation.hs.sexps
+++ b/test/src/indentation.hs.sexps
@@ -75,5 +75,20 @@
)data (Wibble) = (Wibble) (Int)
| (Wobble) (Int)
- | (Vibble) (Int)))))))))))))
+ | (Vibble) (Int)
+
+((lists1) = ([ (foo)
+ , (bar)
+ , ([ (blah)
+ , (blah)
+ , (blah) ])
+ ]))
+
+((lists2) = ([
+ (foo)
+((, (bar))
+)]))
+
+((lists3) = ([ (foo) ,
+ (bar) ]))))))))))))))
)))
\ No newline at end of file
diff --git a/test/src/indentation.hs.syntax b/test/src/indentation.hs.syntax
index 115fdcb..2efb248 100644
--- a/test/src/indentation.hs.syntax
+++ b/test/src/indentation.hs.syntax
@@ -76,3 +76,18 @@ wwwwwwwwwww _ ww>
wwww wwwwww _ wwwwww www>
_ wwwwww www>
_ wwwwww www>
+>
+wwwwww _ ( www>
+ . www>
+ . ( wwww>
+ . wwww>
+ . wwww )>
+ )>
+>
+wwwwww _ (>
+ www>
+. www>
+)>
+>
+wwwwww _ ( www .>
+ www )>
- [nongnu] elpa/haskell-tng-mode fc4d3e3 127/385: compilation mode supports multiline error spans, (continued)
- [nongnu] elpa/haskell-tng-mode fc4d3e3 127/385: compilation mode supports multiline error spans, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 88bad65 128/385: visually distinguish compile errors and warnings, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9dc0abc 129/385: alt indentation levels should be ordered, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 879fc34 130/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1009082 140/385: append indentation test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 88b17d4 137/385: started indentation rules, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode cf22f3a 138/385: simplify indentation testing, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a0f777e 166/385: Revert "duplicate ; tokens to be used as terminators", ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2320b89 167/385: alternative to smie-rules-* in :elem and :list-intro, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 60d8c20 149/385: indent "case of", ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7f9afd2 159/385: list indentation,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 6e70344 165/385: duplicate ; tokens to be used as terminators, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ab5252b 169/385: rearrange alts, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e1aba33 168/385: fix a layout bug in lists and records, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2c6c772 150/385: better WLDO indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3f54673 155/385: don't fontify toplevel, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 32175c0 158/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8c2e3f7 157/385: better symid indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode bc5c827 160/385: tuple indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e0acc42 156/385: better tasty error detection, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c211672 174/385: indentation for hanging type definition, ELPA Syncer, 2021/10/06