[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode f2ce737 038/385: neutral
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode f2ce737 038/385: neutral |
Date: |
Tue, 5 Oct 2021 23:58:57 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit f2ce7373602ae9cf3492fe938fc7ae235229a612
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
neutral
---
haskell-tng-font-lock.el | 65 +++++++++++++++++++++++++++---------------------
1 file changed, 37 insertions(+), 28 deletions(-)
diff --git a/haskell-tng-font-lock.el b/haskell-tng-font-lock.el
index 2c1d5b1..db62463 100644
--- a/haskell-tng-font-lock.el
+++ b/haskell-tng-font-lock.el
@@ -114,21 +114,22 @@
(: symbol-start (char ?\\))))
. 'haskell-tng:keyword)
- ;; ;; TypeFamilies
- ;; (,(rx word-start "type" (+ space) (group "family") word-end)
- ;; (1 'haskell-tng:keyword))
- ;; ;; EXT:TypeFamilies (associated types, is this the right extension?)
-
- ;; ;; Types
- ;; (haskell-tng:font:explicit-type:keyword
- ;; (1 'haskell-tng:type keep))
- ;; (haskell-tng:font:topdecl:keyword
- ;; (1 'haskell-tng:type keep))
- ;; (haskell-tng:font:type:keyword
- ;; (1 'haskell-tng:type keep))
- ;; (haskell-tng:font:deriving:keyword
- ;; (1 'haskell-tng:keyword keep)
- ;; (2 'haskell-tng:type keep))
+ ;; TypeFamilies
+ (,(rx word-start "type" (+ space) (group "family") word-end)
+ (1 'haskell-tng:keyword))
+ ;; EXT:TypeFamilies (associated types, is this the right extension?)
+
+ ;; Types
+ (haskell-tng:font:explicit-type:keyword
+ (1 'haskell-tng:type keep))
+ (haskell-tng:font:topdecl:keyword
+ (1 'haskell-tng:type keep))
+ (haskell-tng:font:type:keyword
+ (1 'haskell-tng:type keep))
+ (haskell-tng:font:deriving:keyword
+ (1 'haskell-tng:keyword keep)
+ (2 'haskell-tng:type keep))
+ ;; TODO don't colour parens
;; TypeApplications: Unfortunately it is not possible to disambiguate
;; between type applications when the following type is in parentheses, as
@@ -158,7 +159,7 @@
(haskell-tng:font:multiline:anchor-rewind) nil
(1 'haskell-tng:keyword)
(2 'haskell-tng:module))
- (haskell-tng:font:paren-search-forward
+ (haskell-tng:font:explicit-constructors
(haskell-tng:font:multiline:anchor-rewind 1)
(haskell-tng:font:multiline:anchor-rewind)
(0 'haskell-tng:constructor))
@@ -177,17 +178,22 @@
;; TODO: numeric / char primitives?
;; TODO: haddock, different face vs line comments, and some markup.
- ;; ;; top-level
- ;; (,(rx-to-string toplevel)
- ;; . 'haskell-tng:toplevel)
+ ;; top-level
+ (,(rx-to-string toplevel)
+ . 'haskell-tng:toplevel)
- ;; ;; uses of F.Q.N.s
- ;; (,(rx-to-string `(: symbol-start (+ (: ,conid "."))))
- ;; . 'haskell-tng:module)
+ ;; uses of F.Q.N.s
+ (,(rx-to-string `(: symbol-start (+ (: ,conid "."))))
+ . 'haskell-tng:module)
- ;; ;; constructors
- ;; (,(rx-to-string `(: symbol-start (| ,conid ,consym) symbol-end))
- ;; . 'haskell-tng:constructor)
+ ;; constructors
+ (,(rx-to-string `(: symbol-start (| ,conid ,consym) symbol-end))
+ . 'haskell-tng:constructor)
+
+ ;; some things look nicer without faces
+ (,(rx (any ?\( ?\) ?\[ ?\] ?\{ ?\} ?,))
+ (0 'default t))
+ ;; TODO: remove faces instead of adding 'default
)))
@@ -205,10 +211,13 @@ If there is no match for GROUP, move to the end of the
line, canceling this ANCH
(forward-char jump))
(match-end 0)))
-(defun haskell-tng:font:paren-search-forward (limit)
- "Match the contents of balanced parenthesis."
+(defun haskell-tng:font:explicit-constructors (limit)
+ "Finds paren blocks of constructors when in an import statement.
+Some complexity to avoid matching on operators."
(let ((start (point)))
- (when (re-search-forward "(" limit t)
+ (when (re-search-forward
+ (rx (any lower) (* space) "(")
+ limit t)
(let ((open (point)))
(when-let (close (haskell-tng:paren-close))
(when (<= close limit)
- [nongnu] elpa/haskell-tng-mode 7bc3218 010/385: extend types in parens, (continued)
- [nongnu] elpa/haskell-tng-mode 7bc3218 010/385: extend types in parens, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 52f0cb9 011/385: expand parens, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode f99ca77 012/385: fixup! expand parens, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode bd8f905 016/385: almost there, regions not being expanded, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode db064be 024/385: dank macro for font-lock extends/keyword, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 639fc6c 018/385: multiline types and font-lock-multiline, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode cc739ad 020/385: multiline topdecl type sections, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 595bd44 034/385: type families, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 77d6ec5 019/385: cleaned up multiline explicit types, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode fa32b46 037/385: finally caught the bug in anchor pre/post resetting, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode f2ce737 038/385: neutral,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 95ab59c 014/385: multiline type matching seems to work, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 85272cb 029/385: fixup! fixup! improve the multiline font macro, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 00f7d84 002/385: simplify names, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 111396f 004/385: converted many font-face rules to the rx DSL, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 6f8258c 009/385: thinking about multiline, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 5536d23 025/385: all font locks use the new macro, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode a7a90ea 028/385: fixup! improve the multiline font macro, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode b9bc414 027/385: improve the multiline font macro, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode ea77bb2 017/385: fixup! almost there, regions not being expanded, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 2b82b2f 022/385: fixup! fixup! multiline topdecl type sections, ELPA Syncer, 2021/10/05