[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 0506391 109/385: module ... where indents
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 0506391 109/385: module ... where indents to 0 |
Date: |
Tue, 5 Oct 2021 23:59:11 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 05063912dba1a4a56ba34be1b05065ccd138c000
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
module ... where indents to 0
---
haskell-tng-smie.el | 11 ++++++++---
test/src/grammar.hs.sexps | 4 ++--
test/src/layout.hs.insert.indent | 2 +-
test/src/layout.hs.sexps | 4 ++--
test/src/medley.hs.insert.indent | 8 ++++----
5 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 53dc63f..0a7cb6c 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -62,6 +62,7 @@
;; WLDOs
(wldo
+ ("module" blk "where" blk)
(blk "where" blk)
("let" blk "in")
("do" blk)
@@ -97,9 +98,11 @@
(:after
(pcase arg
- ((or "::" "=" "where" "let" "do" "of")
- ;; TODO module where should have column 0
- ;; TODO wtf is happening with the line "class Get a s where"
+ ("where"
+ (if (smie-rule-parent-p "module")
+ '(column . 0)
+ smie-indent-basic))
+ ((or "::" "=" "let" "do" "of")
smie-indent-basic)
))
@@ -175,6 +178,8 @@ current line."
#'haskell-tng-smie:indent-cycle
nil 'local)
+ ;; TODO alternative to indent-for-tab-command that does alignment
+
(smie-setup
haskell-tng-smie:grammar
#'haskell-tng-smie:rules
diff --git a/test/src/grammar.hs.sexps b/test/src/grammar.hs.sexps
index 1f02b76..18e71bd 100644
--- a/test/src/grammar.hs.sexps
+++ b/test/src/grammar.hs.sexps
@@ -1,8 +1,8 @@
-- | Tests for grammar rules i.e. sexps, not indentation
-((module) (Foo.(Bar)) (where)
+((module (Foo.(Bar)) (where)
((calc) (::) (Int) -> (Int)
((calc) (a) = (if (a) < ((10)
(then) (a) + (a) * (a) + ((a)
(else) ((a) + (a)) * ((a) + (a))))))
-))
\ No newline at end of file
+)))
\ No newline at end of file
diff --git a/test/src/layout.hs.insert.indent b/test/src/layout.hs.insert.indent
index 18cd6ad..22d0aa6 100644
--- a/test/src/layout.hs.insert.indent
+++ b/test/src/layout.hs.insert.indent
@@ -1,7 +1,7 @@
-- Figure 2.1 from the Haskell2010 report
v
module AStack( Stack, push, pop, top, size ) where
-. v
+v
data Stack a = Empty
. . v
| MkStack a (Stack a)
diff --git a/test/src/layout.hs.sexps b/test/src/layout.hs.sexps
index d5a45a1..de8f0a1 100644
--- a/test/src/layout.hs.sexps
+++ b/test/src/layout.hs.sexps
@@ -1,5 +1,5 @@
-- Figure 2.1 from the Haskell2010 report
-((module) (AStack)( (Stack), (push), (pop), (top), (size) ) (where)
+((module (AStack)( (Stack), (push), (pop), (top), (size) ) (where)
(((data) (Stack) (a) = (Empty)
(|) (MkStack) (a) ((Stack) (a))
@@ -17,4 +17,4 @@
((top) (::) (Stack) (a) -> (a))
((top) ((MkStack) (x) (s)) = (x))) -- top Empty is an error
-))
\ No newline at end of file
+)))
\ No newline at end of file
diff --git a/test/src/medley.hs.insert.indent b/test/src/medley.hs.insert.indent
index 2469ed6..cc4147d 100644
--- a/test/src/medley.hs.insert.indent
+++ b/test/src/medley.hs.insert.indent
@@ -7,7 +7,7 @@ v
-- | This file is a medley of various constructs and some corner cases
v
module Foo.Bar.Main
-. . v
+. . v
( Wibble(..), Wobble(Wobb, (!!!)), Woo
. . v
-- * Operations
@@ -15,11 +15,11 @@ module Foo.Bar.Main
, getFooByBar, getWibbleByWobble
. . v
, module Bloo.Foo
-. . v
+. . v
) where
-. v
+v .
-. v
+v .
import Control.Applicative (many, optional, pure, (<*>), (<|>))
v
import Data.Foldable (traverse_)
- [nongnu] elpa/haskell-tng-mode 79aeb82 076/385: most of the grammar, (continued)
- [nongnu] elpa/haskell-tng-mode 79aeb82 076/385: most of the grammar, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7eaef51 078/385: optimisation in the sexp test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode cb0f3d2 082/385: starting indentation rules, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode cfbdae1 084/385: simplify the lexer assertion language, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 0c5acb7 087/385: lexer and grammar supports symid, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6c520bc 093/385: fixes for type level lists, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f085f16 097/385: indentation regression tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 01ea0b8 103/385: heuristic alternative indentation levels, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c20ea4f 096/385: infix varid as symid, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode bfe859a 095/385: notes about lexers, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 0506391 109/385: module ... where indents to 0,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode d9bbcdd 111/385: next steps, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6cf67bf 105/385: indentation can't handle mismatched parens, don't test for it, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 25b15eb 102/385: indentation alternatives wiring, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e023657 107/385: SMIE wishlist, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 497214b 119/385: syntax tests and bugfixes, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode df5d2c5 122/385: better whitespace gap detection, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3b7cd02 123/385: some todos, ELPA Syncer, 2021/10/06
- [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