[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 7326aad 041/385: modules and more efficie
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 7326aad 041/385: modules and more efficient none |
Date: |
Tue, 5 Oct 2021 23:58:57 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 7326aada1c3ec35002d571d10938e1d17242f37b
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
modules and more efficient none
---
haskell-tng-font-lock.el | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/haskell-tng-font-lock.el b/haskell-tng-font-lock.el
index bda9ce4..24fc9cb 100644
--- a/haskell-tng-font-lock.el
+++ b/haskell-tng-font-lock.el
@@ -114,6 +114,10 @@
(: symbol-start (char ?\\))))
. 'haskell-tng:keyword)
+ ;; some things look nicer without faces
+ (,(rx (any ?\( ?\) ?\[ ?\] ?\{ ?\} ?,))
+ (0 'default))
+
;; TypeFamilies
(,(rx word-start "type" (+ space) (group "family") word-end)
(1 'haskell-tng:keyword))
@@ -139,8 +143,6 @@
(group (opt ,qual) (| ,conid ,consym))))
(1 'haskell-tng:type))
- ;; TODO modules
-
;; imports
(haskell-tng:font:import:keyword
(,(rx-to-string
@@ -162,14 +164,29 @@
(haskell-tng:font:explicit-constructors
(haskell-tng:font:multiline:anchor-rewind 1)
(haskell-tng:font:multiline:anchor-rewind)
- (0 'haskell-tng:constructor))
+ (0 'haskell-tng:constructor keep))
(,(rx-to-string `(: word-start ,conid word-end))
(haskell-tng:font:multiline:anchor-rewind 1)
(haskell-tng:font:multiline:anchor-rewind)
- (0 'haskell-tng:type))
+ (0 'haskell-tng:type keep))
;; EXT:ExplicitNamespaces
)
+ (haskell-tng:font:module:keyword
+ (,(rx-to-string `(: word-start "module" word-end (+ space)
+ (group symbol-start (* ,conid ".") ,conid
symbol-end)))
+ (haskell-tng:font:multiline:anchor-rewind)
+ (haskell-tng:font:multiline:anchor-rewind)
+ (1 'haskell-tng:module))
+ (haskell-tng:font:explicit-constructors
+ (haskell-tng:font:multiline:anchor-rewind 1)
+ (haskell-tng:font:multiline:anchor-rewind)
+ (0 'haskell-tng:constructor keep))
+ (,(rx-to-string `(: word-start ,conid word-end))
+ (haskell-tng:font:multiline:anchor-rewind 1)
+ (haskell-tng:font:multiline:anchor-rewind)
+ (0 'haskell-tng:type keep)))
+
;; TODO: pragmas
;; TODO: numeric / char primitives?
;; TODO: haddock, different face vs line comments, and some markup.
@@ -186,11 +203,6 @@
(,(rx-to-string `(: symbol-start (| ,conid ,consym) symbol-end))
. 'haskell-tng:constructor)
- ;; some things look nicer without faces
- (haskell-tng:font:none
- (0 'default t))
- ;; TODO: remove faces instead of adding 'default
-
)))
(defun haskell-tng:font:multiline:anchor-rewind (&optional group jump)
@@ -220,16 +232,6 @@ Some complexity to avoid matching on operators."
(goto-char open)
(re-search-forward (rx (+ anything)) close t)))))))
-(defun haskell-tng:font:none (limit)
- "Things that should not be fontified."
- (when-let ((p (re-search-forward
- (rx (any ?\( ?\) ?\[ ?\] ?\{ ?\} ?,))
- limit t))
- (pp (syntax-ppss)))
- (if (or (nth 3 pp) (nth 4 pp))
- (haskell-tng:font:none limit)
- p)))
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Here are `function' matchers for use in `font-lock-keywords' and
;; `font-lock-extend-region-functions' procedures for extending the region.
- [nongnu] elpa/haskell-tng-mode f5961e6 099/385: indentation cycles are really complicated..., (continued)
- [nongnu] elpa/haskell-tng-mode f5961e6 099/385: indentation cycles are really complicated..., ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 6e4849c 112/385: some compilation test cases, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode cb1d2db 106/385: newline shouldn't trigger indent cycling, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f342041 118/385: better SMIE blinkers, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 249f507 121/385: support whitespace gaps, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6ae08ec 021/385: fixup! multiline topdecl type sections, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a808c7b 033/385: notes on language extensions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a4ec07a 032/385: fix install instructions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3e8efdc 023/385: type aliases and deriving, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ad570a0 039/385: out of date comments, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7326aad 041/385: modules and more efficient none,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 49611c6 042/385: regression tests for fontification, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c22f7d2 045/385: thoughts on future plans, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a5f779d 047/385: initial SMIE tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode dae43ac 049/385: improvements to the default lexer, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d76c6ad 053/385: some thoughts on WLDO detection, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3e53f56 055/385: cleaner lexer test output, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 73e2b11 063/385: the new lexer works!, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8e1a225 068/385: sexp tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 269be91 072/385: revert broken grammar rules, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3194e62 074/385: stefan to the rescue, ELPA Syncer, 2021/10/06