branch: elpa/haskell-tng-mode commit ae1d39946349414be20c4aa5e40ca1d3d25dbce2 Author: Tseen She <ts33n....@gmail.com> Commit: Tseen She <ts33n....@gmail.com>
backslashes are only keywords when used in lambdas --- haskell-tng-rx.el | 6 +++++- test/src/medley.hs | 2 +- test/src/medley.hs.faceup | 2 +- test/src/medley.hs.imenu | 10 +++++----- test/src/medley.hs.layout | 2 +- test/src/medley.hs.syntax | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/haskell-tng-rx.el b/haskell-tng-rx.el index 4d54d73..bbeed95 100644 --- a/haskell-tng-rx.el +++ b/haskell-tng-rx.el @@ -53,7 +53,11 @@ give false positives." `(| '(| symbol-end word-start)) ) (| "[]" "()") ;; empty list / void - (: symbol-start (char ?\\)))) ;; TODO only for lambdas, don't include ops like \\ + (: symbol-start (char ?\\) + ;; don't include ops like \\ + ,(if hack + '(| space word-start point) + '(| space word-start))))) (defconst haskell-tng--rx-newline '(| ?\n diff --git a/test/src/medley.hs b/test/src/medley.hs index d5edf35..15793b9 100644 --- a/test/src/medley.hs +++ b/test/src/medley.hs @@ -46,7 +46,7 @@ multiline2 = "\ difficult = foo' 'a' 2 -foo = "wobble (wibble)" +foo = "wobble (wibble)" \\ '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 a441e22..b6ca577 100644 --- a/test/src/medley.hs.faceup +++ b/test/src/medley.hs.faceup @@ -46,7 +46,7 @@ multiline2 «:haskell-tng-keyword-face:=» «s:"\ difficult «:haskell-tng-keyword-face:=» foo' «s:'a'» 2 -foo «:haskell-tng-keyword-face:=» «s:"wobble (wibble)"» +foo «:haskell-tng-keyword-face:=» «s:"wobble (wibble)"» \\ «s:'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 db76804..00247cc 100644 --- a/test/src/medley.hs.imenu +++ b/test/src/medley.hs.imenu @@ -7,8 +7,8 @@ ("multiline2" . 1767) ("difficult" . 1796) ("foo" . 1820) - ("optionsParser" . 3396) - ("getUsers" . 4371) - ("test" . 4740) - ("cases" . 4763) - ("bar" . 4835)) + ("optionsParser" . 3403) + ("getUsers" . 4378) + ("test" . 4747) + ("cases" . 4770) + ("bar" . 4842)) diff --git a/test/src/medley.hs.layout b/test/src/medley.hs.layout index eb68bee..b650005 100644 --- a/test/src/medley.hs.layout +++ b/test/src/medley.hs.layout @@ -46,7 +46,7 @@ module Foo.Bar.Main ;difficult = foo' 'a' 2 -;foo = "wobble (wibble)" +;foo = "wobble (wibble)" \\ 'a' ;class Get a s where {get :: Set s -> a diff --git a/test/src/medley.hs.syntax b/test/src/medley.hs.syntax index 60e5317..a936683 100644 --- a/test/src/medley.hs.syntax +++ b/test/src/medley.hs.syntax @@ -46,7 +46,7 @@ wwwwwwwwww _ "_> > wwwwwwwww _ wwww "w" w> > -www _ "wwwwww (wwwwww)"> +www _ "wwwwww (wwwwww)" __ "w"> > wwwww www w w wwwww> www __ www w __ w>