[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode bc5c827 160/385: tuple indentation
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode bc5c827 160/385: tuple indentation |
Date: |
Tue, 5 Oct 2021 23:59:22 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit bc5c827954b052b7377e5bb4e39ebac6c70073e3
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
tuple indentation
---
haskell-tng-smie.el | 9 +++++----
test/haskell-tng-indent-test.el | 3 +--
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, 175 insertions(+), 10 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 267d63b..e1f3ccd 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -177,7 +177,7 @@ information, to aid in the creation of new rules."
parent grand)))))
(cond
- ((smie-rule-parent-p "[") ",")
+ ((smie-rule-parent-p "[" "(") ",")
((or (smie-rule-parent-p "|")
(and (smie-rule-parent-p "=")
@@ -213,7 +213,7 @@ 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)
+ ((or "[" "(") 2)
("," (smie-rule-separator method))
((or "$" "SYMID")
(if (smie-rule-hanging-p) 2 (smie-rule-parent)))
@@ -240,8 +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)))
+ ((or "[" "(")
+ (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 23ea996..7733261 100644
--- a/test/haskell-tng-indent-test.el
+++ b/test/haskell-tng-indent-test.el
@@ -14,8 +14,7 @@
;; FIXME implement more indentation rules
;;
-;; TODO tuples
-;; TODO records
+;; TODO records (resolve WLDO ambiguity)
;; TODO multiline type signatures
;; TODO if/then/else
diff --git a/test/src/indentation.hs b/test/src/indentation.hs
index 3bccfb8..488d17e 100644
--- a/test/src/indentation.hs
+++ b/test/src/indentation.hs
@@ -91,3 +91,18 @@ lists2 = [
lists3 = [ foo ,
bar ]
+
+tuples1 = ( foo
+ , bar
+ , ( blah
+ , blah
+ , blah )
+ )
+
+tuples2 = (
+ foo
+, bar
+)
+
+tuples3 = ( foo ,
+ bar )
diff --git a/test/src/indentation.hs.append.indent
b/test/src/indentation.hs.append.indent
index 00c2ade..8732e21 100644
--- a/test/src/indentation.hs.append.indent
+++ b/test/src/indentation.hs.append.indent
@@ -185,4 +185,34 @@ lists3 = [ foo ,
bar ]
v 1
-v 1
\ No newline at end of file
+v 1
+tuples1 = ( foo
+1 v
+ , bar
+1 v
+ , ( blah
+2 1 v
+ , blah
+1 2 v
+ , blah )
+2 v 1
+ )
+v 1 2
+
+v 1 2
+tuples2 = (
+1 v
+ foo
+v 1
+, bar
+v
+)
+v
+
+v
+tuples3 = ( 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 b107c08..380ef7b 100644
--- a/test/src/indentation.hs.insert.indent
+++ b/test/src/indentation.hs.insert.indent
@@ -183,4 +183,34 @@ v
lists3 = [ foo ,
1 v
bar ]
-v 1
\ No newline at end of file
+v 1
+
+v 1
+tuples1 = ( 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
+tuples2 = (
+1 v
+ foo
+1 v
+, bar
+v
+)
+v
+
+v
+tuples3 = ( 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 3befa99..a85ba62 100644
--- a/test/src/indentation.hs.layout
+++ b/test/src/indentation.hs.layout
@@ -91,4 +91,19 @@ module Indentation where
;lists3 = [ foo ,
bar ]
+
+;tuples1 = ( foo
+ , bar
+ , ( blah
+ , blah
+ , blah )
+ )
+
+;tuples2 = (
+ foo
+;, bar
+;)
+
+;tuples3 = ( foo ,
+ bar )
}
\ No newline at end of file
diff --git a/test/src/indentation.hs.lexer b/test/src/indentation.hs.lexer
index cf7d432..68e0020 100644
--- a/test/src/indentation.hs.lexer
+++ b/test/src/indentation.hs.lexer
@@ -91,4 +91,19 @@ VARID
; VARID = « VARID ,
VARID »
+
+; 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 70540ec..5f54fa1 100644
--- a/test/src/indentation.hs.reindent
+++ b/test/src/indentation.hs.reindent
@@ -183,4 +183,34 @@ v
v 1
lists3 = [ foo ,
1 v
- bar ]
\ No newline at end of file
+ bar ]
+v 1
+
+v 12
+tuples1 = ( 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
+tuples2 = (
+1 v
+ foo
+v 1
+, bar
+v
+)
+v
+
+v 1
+tuples3 = ( 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 16a638a..35c2bcf 100644
--- a/test/src/indentation.hs.sexps
+++ b/test/src/indentation.hs.sexps
@@ -90,5 +90,20 @@
)]))
((lists3) = ([ (foo) ,
- (bar) ]))))))))))))))
+ (bar) ]))
+
+((tuples1) = ( (foo)
+ , (bar)
+ , ( (blah)
+ , (blah)
+ , (blah) )
+ ))
+
+((tuples2) = (
+ (foo)
+((, (bar))
+)))
+
+((tuples3) = ( (foo) ,
+ (bar) ))))))))))))))
)))
\ No newline at end of file
diff --git a/test/src/indentation.hs.syntax b/test/src/indentation.hs.syntax
index 2efb248..ce0322d 100644
--- a/test/src/indentation.hs.syntax
+++ b/test/src/indentation.hs.syntax
@@ -91,3 +91,18 @@ wwwwww _ (>
>
wwwwww _ ( www .>
www )>
+>
+wwwwwww _ ( www>
+ . www>
+ . ( wwww>
+ . wwww>
+ . wwww )>
+ )>
+>
+wwwwwww _ (>
+ www>
+. www>
+)>
+>
+wwwwwww _ ( www .>
+ www )>
- [nongnu] elpa/haskell-tng-mode 2320b89 167/385: alternative to smie-rules-* in :elem and :list-intro, (continued)
- [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, 2021/10/06
- [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 <=
- [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
- [nongnu] elpa/haskell-tng-mode ef7f335 171/385: note stack compatibility, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 86bcd98 175/385: constraint indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e1c0f0a 179/385: allow indentation option to be tested, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1cceb64 182/385: cleaner tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b1122e4 188/385: allow users to use unsupported build tools, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode bd4ff6f 192/385: standardise on naming convention:, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3b5ac7f 190/385: package-lint, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a227f7e 200/385: blank lines end a run of type definitions, ELPA Syncer, 2021/10/06