[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 1d74d5f 279/385: backslash bughunting
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 1d74d5f 279/385: backslash bughunting |
Date: |
Tue, 5 Oct 2021 23:59:47 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 1d74d5ff00ce65a8802a23e8b5fed071f533c6cc
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
backslash bughunting
---
haskell-tng-rx.el | 13 +++++++------
test/src/medley.hs | 4 ++++
test/src/medley.hs.faceup | 6 +++++-
test/src/medley.hs.imenu | 13 ++++++++-----
test/src/medley.hs.layout | 4 ++++
test/src/medley.hs.lexer | 6 +++++-
test/src/medley.hs.syntax | 4 ++++
7 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/haskell-tng-rx.el b/haskell-tng-rx.el
index bbeed95..e91154c 100644
--- a/haskell-tng-rx.el
+++ b/haskell-tng-rx.el
@@ -52,12 +52,13 @@ give false positives." `(|
'(| symbol-end word-start point)
'(| symbol-end word-start))
)
- (| "[]" "()") ;; empty list / void
- (: symbol-start (char ?\\)
- ;; don't include ops like \\
- ,(if hack
- '(| space word-start point)
- '(| space word-start)))))
+ ;; empty list / void
+ (| "[]" "()")
+ ;; TODO don't include ops like \\. Using word-start here conflicts with
+ ;; backwards lexing and also misses lambdas with params in parens, this is
+ ;; too restrictive. We match more than one \ here so as not to break
+ ;; backwards lexing.
+ (: symbol-start (+ (char ?\\)))))
(defconst haskell-tng--rx-newline
'(| ?\n
diff --git a/test/src/medley.hs b/test/src/medley.hs
index 15793b9..72c503f 100644
--- a/test/src/medley.hs
+++ b/test/src/medley.hs
@@ -48,6 +48,10 @@ difficult = foo' 'a' 2
foo = "wobble (wibble)" \\ 'a'
+lambdas1 = \a -> a
+lambdas2 = \ a -> a
+lambdas3 = \(a) -> a
+
class Get a s where
get :: Set s -> a
diff --git a/test/src/medley.hs.faceup b/test/src/medley.hs.faceup
index b6ca577..17b02be 100644
--- a/test/src/medley.hs.faceup
+++ b/test/src/medley.hs.faceup
@@ -46,7 +46,11 @@ multiline2 «:haskell-tng-keyword-face:=» «s:"\
difficult «:haskell-tng-keyword-face:=» foo' «s:'a'» 2
-foo «:haskell-tng-keyword-face:=» «s:"wobble (wibble)"» \\ «s:'a'»
+foo «:haskell-tng-keyword-face:=» «s:"wobble (wibble)"»
«:haskell-tng-keyword-face:\\» «s:'a'»
+
+lambdas1 «:haskell-tng-keyword-face:=» «:haskell-tng-keyword-face:\»a
«:haskell-tng-keyword-face:->» a
+lambdas2 «:haskell-tng-keyword-face:=» «:haskell-tng-keyword-face:\» a
«:haskell-tng-keyword-face:->» a
+lambdas3 «:haskell-tng-keyword-face:=»
«:haskell-tng-keyword-face:\(»a«:haskell-tng-keyword-face:)»
«:haskell-tng-keyword-face:->» a
«:haskell-tng-keyword-face:class»«:haskell-tng-type-face: Get a s
»«:haskell-tng-keyword-face:where»
get «:haskell-tng-keyword-face:::»«:haskell-tng-type-face: Set s
»«:haskell-tng-keyword-face:->»«:haskell-tng-type-face: a
diff --git a/test/src/medley.hs.imenu b/test/src/medley.hs.imenu
index 00247cc..5ee08d2 100644
--- a/test/src/medley.hs.imenu
+++ b/test/src/medley.hs.imenu
@@ -7,8 +7,11 @@
("multiline2" . 1767)
("difficult" . 1796)
("foo" . 1820)
- ("optionsParser" . 3403)
- ("getUsers" . 4378)
- ("test" . 4747)
- ("cases" . 4770)
- ("bar" . 4842))
+ ("lambdas1" . 1852)
+ ("lambdas2" . 1871)
+ ("lambdas3" . 1891)
+ ("optionsParser" . 3464)
+ ("getUsers" . 4439)
+ ("test" . 4808)
+ ("cases" . 4831)
+ ("bar" . 4903))
diff --git a/test/src/medley.hs.layout b/test/src/medley.hs.layout
index b650005..3e660c5 100644
--- a/test/src/medley.hs.layout
+++ b/test/src/medley.hs.layout
@@ -48,6 +48,10 @@ module Foo.Bar.Main
;foo = "wobble (wibble)" \\ 'a'
+;lambdas1 = \a -> a
+;lambdas2 = \ a -> a
+;lambdas3 = \(a) -> a
+
;class Get a s where
{get :: Set s -> a
diff --git a/test/src/medley.hs.lexer b/test/src/medley.hs.lexer
index d6108dd..55ff768 100644
--- a/test/src/medley.hs.lexer
+++ b/test/src/medley.hs.lexer
@@ -46,7 +46,11 @@ VARID , VARID , VARID »
; VARID = VARID § 2
-; VARID = § SYMID §
+; VARID = § \\ §
+
+; VARID = \ VARID -> VARID
+; VARID = \ VARID -> VARID
+; VARID = \ « VARID » -> VARID
; class CONID VARID VARID where
{ VARID :: CONID VARID => VARID
diff --git a/test/src/medley.hs.syntax b/test/src/medley.hs.syntax
index a936683..2dd3546 100644
--- a/test/src/medley.hs.syntax
+++ b/test/src/medley.hs.syntax
@@ -48,6 +48,10 @@ wwwwwwwww _ wwww "w" w>
>
www _ "wwwwww (wwwwww)" __ "w">
>
+wwwwwwww _ _w __ w>
+wwwwwwww _ _ w __ w>
+wwwwwwww _ _(w) __ w>
+>
wwwww www w w wwwww>
www __ www w __ w>
>
- [nongnu] elpa/haskell-tng-mode 907c8fa 153/385: ImplicitParams indentation, (continued)
- [nongnu] elpa/haskell-tng-mode 907c8fa 153/385: ImplicitParams indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ca00f1f 183/385: thot, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 611711a 208/385: address melpa review, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 89c5c80 223/385: improve smartparens workaround, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e270647 228/385: more robust calls to hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ad5967b 236/385: simpler installation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 599d4f0 283/385: import symbol at point, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9b334f7 275/385: ghcflags, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f221f95 173/385: introduce types and constraints to the grammar, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ae1d399 268/385: backslashes are only keywords when used in lambdas, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1d74d5f 279/385: backslash bughunting,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 499c77f 261/385: abbrev-mode support, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e2e3490 382/385: hide-show supports BOILERPLATE START ... BOILERPLATE END, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a34e796 368/385: improve debugging, ELPA Syncer, 2021/10/06