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

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

[nongnu] elpa/haskell-tng-mode f7e8040 213/385: = ends a type sig


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode f7e8040 213/385: = ends a type sig
Date: Tue, 5 Oct 2021 23:59:33 -0400 (EDT)

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

    = ends a type sig
---
 haskell-tng-font-lock.el  | 4 ++--
 haskell-tng-util.el       | 5 ++---
 test/src/medley.hs        | 1 +
 test/src/medley.hs.faceup | 1 +
 test/src/medley.hs.layout | 3 ++-
 test/src/medley.hs.lexer  | 3 ++-
 test/src/medley.hs.syntax | 1 +
 7 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/haskell-tng-font-lock.el b/haskell-tng-font-lock.el
index 8d18859..acbc923 100644
--- a/haskell-tng-font-lock.el
+++ b/haskell-tng-font-lock.el
@@ -282,8 +282,8 @@ succeeds and may further restrict the FIND search limit."
                             (rx symbol-start "::" symbol-end (group (+ 
anything)))
                             haskell-tng--util-paren-close
                             haskell-tng--util-indent-close-previous
-                            haskell-tng--util-do-bind)
-;; TODO commas end a type signature in a record of functions
+                            haskell-tng--util-type-ender)
+;; TODO commas end a type signature in a record of functions (but can be used 
in tuples, so complex)
 
 (haskell-tng--font-lock-multiline topdecl
                             (rx line-start (| "data" "newtype" "class" 
"instance") word-end)
diff --git a/haskell-tng-util.el b/haskell-tng-util.el
index 4155bd7..46b7f44 100644
--- a/haskell-tng-util.el
+++ b/haskell-tng-util.el
@@ -35,12 +35,11 @@
             (throw 'closed (point))))
         nil))))
 
-(defun haskell-tng--util-do-bind (&optional pos)
+(defun haskell-tng--util-type-ender (&optional pos)
   ;; trivial, should just be called as an inline regexp
-  "The next `<-'"
   (save-excursion
     (goto-char (or pos (point)))
-    (re-search-forward "<-" nil t)))
+    (re-search-forward (rx (| "<-" "=")) nil t)))
 
 (defun haskell-tng--util-next-where (&optional pos)
   ;; trivial, should just be called as an inline regexp
diff --git a/test/src/medley.hs b/test/src/medley.hs
index d55706a..46199a3 100644
--- a/test/src/medley.hs
+++ b/test/src/medley.hs
@@ -138,6 +138,7 @@ deriving newtype instance FromJSON Treble
 
 foo = do
   bar :: Wibble <- baz
+  let waz :: Wazzy = woz
   where baz = _
   -- checking that comments are ignored in layout
   -- and that a starting syntax entry is ok
diff --git a/test/src/medley.hs.faceup b/test/src/medley.hs.faceup
index a1a7da7..a21f0f3 100644
--- a/test/src/medley.hs.faceup
+++ b/test/src/medley.hs.faceup
@@ -138,6 +138,7 @@ optionsParser 
«:haskell-tng-keyword-face:::»«:haskell-tng-type-face: Opts.Par
 
 foo «:haskell-tng-keyword-face:=» «:haskell-tng-keyword-face:do»
   bar «:haskell-tng-keyword-face:::»«:haskell-tng-type-face: Wibble 
»«:haskell-tng-keyword-face:<-» baz
+  «:haskell-tng-keyword-face:let» waz 
«:haskell-tng-keyword-face:::»«:haskell-tng-type-face: Wazzy 
»«:haskell-tng-keyword-face:=» woz
   «:haskell-tng-keyword-face:where» baz «:haskell-tng-keyword-face:=» 
«:haskell-tng-keyword-face:_»
   «m:-- »«x:checking that comments are ignored in layout
 »  «m:-- »«x:and that a starting syntax entry is ok
diff --git a/test/src/medley.hs.layout b/test/src/medley.hs.layout
index 178e162..0efd464 100644
--- a/test/src/medley.hs.layout
+++ b/test/src/medley.hs.layout
@@ -138,7 +138,8 @@ module Foo.Bar.Main
 
 ;foo = do
   {bar :: Wibble <- baz
-  ;where {baz = _
+  ;let {waz :: Wazzy = woz
+  };where {baz = _
   -- checking that comments are ignored in layout
   -- and that a starting syntax entry is ok
         ;(+) = _
diff --git a/test/src/medley.hs.lexer b/test/src/medley.hs.lexer
index b676f68..aee34e2 100644
--- a/test/src/medley.hs.lexer
+++ b/test/src/medley.hs.lexer
@@ -138,7 +138,8 @@ CONSYM CONID « CONID » « CONID CONID »
 
 ; VARID = do
 { VARID :: CONID <- VARID
-; where { VARID = _
+; let { VARID :: CONID = VARID
+} ; where { VARID = _
 
 
 ; « SYMID » = _
diff --git a/test/src/medley.hs.syntax b/test/src/medley.hs.syntax
index fe3ab6f..60cbb3d 100644
--- a/test/src/medley.hs.syntax
+++ b/test/src/medley.hs.syntax
@@ -138,6 +138,7 @@ wwwwwwww wwwwwww wwwwwwww wwwwwwww wwwwww>
 >
 www _ ww>
   www __ wwwwww __ www>
+  www www __ wwwww _ www>
   wwwww www _ w>
   __ wwwwwwww wwww wwwwwwww www wwwwwww ww wwwwww>
   __ www wwww w wwwwwwww wwwwww wwwww ww ww>



reply via email to

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