[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode ee07f6d 172/385: type indentation tests
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode ee07f6d 172/385: type indentation tests |
Date: |
Tue, 5 Oct 2021 23:59:25 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit ee07f6d8632ee905fb9a7537c3c50658341f93d3
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
type indentation tests
---
haskell-tng-smie.el | 1 +
test/haskell-tng-indent-test.el | 1 +
test/src/indentation.hs | 23 +++++++++++++++++
test/src/indentation.hs.append.indent | 48 ++++++++++++++++++++++++++++++++++-
test/src/indentation.hs.insert.indent | 48 ++++++++++++++++++++++++++++++++++-
test/src/indentation.hs.layout | 23 +++++++++++++++++
test/src/indentation.hs.lexer | 23 +++++++++++++++++
test/src/indentation.hs.reindent | 48 ++++++++++++++++++++++++++++++++++-
test/src/indentation.hs.sexps | 25 +++++++++++++++++-
test/src/indentation.hs.syntax | 23 +++++++++++++++++
10 files changed, 259 insertions(+), 4 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 15d27de..91aaa65 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -65,6 +65,7 @@
;; operators all have the same precedence
(infixexp
+ ;; TODO : and ': should lex as SYMID
(id ":" infixexp) ;; keyword infix
(id "':" infixexp) ;; DataKinds
(id "SYMID" infixexp))
diff --git a/test/haskell-tng-indent-test.el b/test/haskell-tng-indent-test.el
index cd2e0a3..b2fdb09 100644
--- a/test/haskell-tng-indent-test.el
+++ b/test/haskell-tng-indent-test.el
@@ -15,6 +15,7 @@
;; FIXME implement more indentation rules
;;
;; TODO multiline type signatures
+;; TODO ImplicitParams in type signatures (without parens)
;; TODO if/then/else
;; TODO reindenting needs attention, it's all over the radar
diff --git a/test/src/indentation.hs b/test/src/indentation.hs
index 3a95061..c962b82 100644
--- a/test/src/indentation.hs
+++ b/test/src/indentation.hs
@@ -121,3 +121,26 @@ tuples2 = (
tuples3 = ( foo ,
bar )
+
+types1 :: a -> b -> c
+
+types2 ::
+ a
+ -> b
+ -> c
+
+types3 ::
+ Monad m
+ => a
+ -> b
+ -> c
+
+types4 :: Monad m
+ => (?log :: HasLogger m)
+ => a
+ -> b
+ -> c
+
+types5 :: (Monad m, MonadReader Foo m) =>
+ (?log :: HasLogger m) =>
+ a -> b -> c
diff --git a/test/src/indentation.hs.append.indent
b/test/src/indentation.hs.append.indent
index c52975e..cb53038 100644
--- a/test/src/indentation.hs.append.indent
+++ b/test/src/indentation.hs.append.indent
@@ -245,4 +245,50 @@ tuples3 = ( foo ,
bar )
v 1
-v 1
\ No newline at end of file
+v 1
+types1 :: a -> b -> c
+v
+
+v
+types2 ::
+v
+ a
+v 1
+ -> b
+v 1 2
+ -> c
+v 1 2
+
+v 1 2
+types3 ::
+v
+ Monad m
+v 1
+ => a
+v 1 2
+ -> b
+v 1 2
+ -> c
+v 1 2
+
+v 1 2
+types4 :: Monad m
+v
+ => (?log :: HasLogger m)
+v 1
+ => a
+v 1
+ -> b
+v 1
+ -> c
+v 1
+
+v 1
+types5 :: (Monad m, MonadReader Foo m) =>
+v
+ (?log :: HasLogger m) =>
+v 1
+ a -> b -> c
+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 e9936c4..3e14b25 100644
--- a/test/src/indentation.hs.insert.indent
+++ b/test/src/indentation.hs.insert.indent
@@ -243,4 +243,50 @@ v
tuples3 = ( foo ,
1 v
bar )
-v 1
\ No newline at end of file
+v 1
+
+v 1
+types1 :: a -> b -> c
+v
+
+v
+types2 ::
+2 1 v
+ a
+2 1 v
+ -> b
+2 1 v
+ -> c
+v 1 2
+
+v 1 2
+types3 ::
+2 1 v
+ Monad m
+2 1 v
+ => a
+1 v 2
+ -> b
+2 1 v
+ -> c
+v 1 2
+
+v 1 2
+types4 :: Monad m
+1 v
+ => (?log :: HasLogger m)
+1 v
+ => a
+1 v
+ -> b
+2 1 v
+ -> c
+v 1
+
+v 1
+types5 :: (Monad m, MonadReader Foo m) =>
+2 v 1
+ (?log :: HasLogger m) =>
+1 v
+ a -> b -> c
+v 1
\ No newline at end of file
diff --git a/test/src/indentation.hs.layout b/test/src/indentation.hs.layout
index a252c8d..4eae865 100644
--- a/test/src/indentation.hs.layout
+++ b/test/src/indentation.hs.layout
@@ -121,4 +121,27 @@ module Indentation where
;tuples3 = ( foo ,
bar )
+
+;types1 :: a -> b -> c
+
+;types2 ::
+ a
+ -> b
+ -> c
+
+;types3 ::
+ Monad m
+ => a
+ -> b
+ -> c
+
+;types4 :: Monad m
+ => (?log :: HasLogger m)
+ => a
+ -> b
+ -> c
+
+;types5 :: (Monad m, MonadReader Foo m) =>
+ (?log :: HasLogger m) =>
+ a -> b -> c
}
\ No newline at end of file
diff --git a/test/src/indentation.hs.lexer b/test/src/indentation.hs.lexer
index cd8d2e8..065623e 100644
--- a/test/src/indentation.hs.lexer
+++ b/test/src/indentation.hs.lexer
@@ -121,4 +121,27 @@ VARID
; VARID = « VARID ,
VARID »
+
+; VARID :: VARID -> VARID -> VARID
+
+; VARID ::
+VARID
+-> VARID
+-> VARID
+
+; VARID ::
+CONID VARID
+=> VARID
+-> VARID
+-> VARID
+
+; VARID :: CONID VARID
+=> « VARID :: CONID VARID »
+=> VARID
+-> VARID
+-> VARID
+
+; VARID :: « CONID VARID , CONID CONID VARID » =>
+« VARID :: CONID VARID » =>
+VARID -> VARID -> VARID
}
diff --git a/test/src/indentation.hs.reindent b/test/src/indentation.hs.reindent
index af1c5a31..0e14fdf 100644
--- a/test/src/indentation.hs.reindent
+++ b/test/src/indentation.hs.reindent
@@ -243,4 +243,50 @@ v
v 1
tuples3 = ( foo ,
1 v
- bar )
\ No newline at end of file
+ bar )
+v 1
+
+v 1
+types1 :: a -> b -> c
+v
+
+v 1
+types2 ::
+2 1 v
+ a
+v 1 2
+ -> b
+v 1 2
+ -> c
+v 1 2
+
+v 2 1
+types3 ::
+2 1 v
+ Monad m
+2 1 v
+ => a
+v 1 2
+ -> b
+v 1 2
+ -> c
+v 1 2
+
+v 2 3 1
+types4 :: Monad m
+1 v
+ => (?log :: HasLogger m)
+1 v
+ => a
+v 1
+ -> b
+v 1
+ -> c
+v 1
+
+v 2 1
+types5 :: (Monad m, MonadReader Foo m) =>
+2 v 1
+ (?log :: HasLogger m) =>
+1 v
+ a -> b -> c
\ No newline at end of file
diff --git a/test/src/indentation.hs.sexps b/test/src/indentation.hs.sexps
index ee7ba3c..d0c9771 100644
--- a/test/src/indentation.hs.sexps
+++ b/test/src/indentation.hs.sexps
@@ -120,5 +120,28 @@
))
((tuples3) = ( (foo) ,
- (bar) ))))))))))))))
+ (bar) ))
+
+((types1) (::) (a) -> (b) -> (c))
+
+((types2) (::)
+ (a)
+ -> (b)
+ -> (c))
+
+((types3) (::)
+ (Monad) (m)
+ (=>) (a)
+ -> (b)
+ -> (c))
+
+((types4) (::) (Monad) (m)
+ (=>) ((?log) (::) (HasLogger) (m))
+ (=>) (a)
+ -> (b)
+ -> (c))
+
+((types5) (::) ((Monad) (m), (MonadReader) (Foo) (m)) (=>)
+ ((?log) (::) (HasLogger) (m)) (=>)
+ (a) -> (b) -> (c))))))))))))))
)))
\ No newline at end of file
diff --git a/test/src/indentation.hs.syntax b/test/src/indentation.hs.syntax
index 7c8efad..4e75ba8 100644
--- a/test/src/indentation.hs.syntax
+++ b/test/src/indentation.hs.syntax
@@ -121,3 +121,26 @@ wwwwwww _ (>
>
wwwwwww _ ( www .>
www )>
+>
+wwwwww __ w __ w __ w>
+>
+wwwwww __>
+ w>
+ __ w>
+ __ w>
+>
+wwwwww __>
+ wwwww w>
+ __ w>
+ __ w>
+ __ w>
+>
+wwwwww __ wwwww w>
+ __ (_www __ wwwwwwwww w)>
+ __ w>
+ __ w>
+ __ w>
+>
+wwwwww __ (wwwww w. wwwwwwwwwww www w) __>
+ (_www __ wwwwwwwww w) __>
+ w __ w __ w>
- [nongnu] elpa/haskell-tng-mode 5f81d6b 219/385: bump python version, (continued)
- [nongnu] elpa/haskell-tng-mode 5f81d6b 219/385: bump python version, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8f4d7fc 225/385: advice around smartparens workaround, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4cbf702 205/385: move third party deps to -contrib, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3ff278e 227/385: ability to not continue comments, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode dbcef71 235/385: workaround the env file situation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5892c04 232/385: small things, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 44dc467 248/385: notes on motivation, contributing and collaboration, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6f2b5ee 266/385: font lock CPP, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fdbd0a2 239/385: updates for hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b2e2c3a 293/385: stop stack from being an asshole, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ee07f6d 172/385: type indentation tests,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 59354b6 198/385: support hanging type alignment, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a788ab2 209/385: more efficient layout caching, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f7e8040 213/385: = ends a type sig, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fe9d65d 222/385: helper for yatemplates, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode bc93c3d 224/385: very alpha hsinspect support, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 658ddb6 251/385: docs, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 73a60f5 309/385: cache `which hsinspect` per project, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5707166 365/385: use new ghcflags-provided PATH, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b1c664b 364/385: allow hsinspect population in the background, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ce17d96 376/385: new hsinspect release, ELPA Syncer, 2021/10/06