[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode c6382e1 036/385: almost got it with impor
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode c6382e1 036/385: almost got it with imports, then I lost it... |
Date: |
Tue, 5 Oct 2021 23:58:56 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit c6382e110936695fc4df7a2444187c0a7ae3a3c1
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
almost got it with imports, then I lost it...
---
haskell-tng-font-lock.el | 39 +++++++++++++++++++--------------------
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/haskell-tng-font-lock.el b/haskell-tng-font-lock.el
index 9e04350..e8bff02 100644
--- a/haskell-tng-font-lock.el
+++ b/haskell-tng-font-lock.el
@@ -144,24 +144,26 @@
(haskell-tng:font:import:keyword
(,(rx-to-string
`(: line-start "import" (+ space)
+ ;; FIXME qualified is being missed when there is an `as'
(group (opt word-start "qualified" word-end)) (* space)
;; EXT:PackageImports
;; EXT:Safe, EXT:Trustworthy, EXT:Unsafe
(group symbol-start (* ,conid ".") ,conid symbol-end) (*
,bigspace)
- (group (opt word-start "as" word-end (* space)))
- (group (opt word-start "hiding" word-end (* space)))))
+ (group (opt word-start "as" word-end)) (* space)
+ (group (opt word-start "hiding" word-end))))
(haskell-tng:font:multiline:pre) nil
(1 'haskell-tng:keyword)
(2 'haskell-tng:module)
(3 'haskell-tng:keyword)
(4 'haskell-tng:keyword))
- (,(rx word-start "as" (+ space) (group (+ word) word-end))
+ (,(rx-to-string `(: word-start "as" (+ space)
+ word-start (group ,conid) word-end))
(haskell-tng:font:multiline:pre) nil
(1 'haskell-tng:module))
;; (haskell-tng:font:paren-search-forward
- ;; (haskell-tng:font:multiline:pre 1 0) nil
+ ;; (haskell-tng:font:multiline:pre 1) nil
;; (0 'haskell-tng:constructor))
- ;; TODO FIXME the paren in group 1
+ ;; FIXME: the import incorrectly detected
;; (,(rx-to-string `(: word-start ,conid word-end))
;; (haskell-tng:font:multiline:pre 1) nil
;; (0 'haskell-tng:type))
@@ -189,26 +191,24 @@
(defun haskell-tng:font:multiline:pre (&optional group jump)
"MATCH-ANCHORED moving point to group beginning (plus JUMP) and extend
LIMIT."
(setq group (or group 0))
- ;; TODO: does a group inside an opt give nil? That would be better
(when (match-string group)
- (when (< 0 group)
- (message "MATCHED GROUP %s AS %s"
- group
- (match-string group)))
(goto-char (match-beginning group))
+ ;; (when (< 0 group)
+ ;; (message "MATCHED GROUP %s to %s, limiting %s"
+ ;; group (match-string group)
+ ;; (buffer-substring (match-beginning group) (match-end 0))))
(when jump
- (forward-char jump)
- (message "JUMPING FOR %s TO %s"
- (match-string group)
- (buffer-substring-no-properties (point) (+ 10 (point))))))
+ (forward-char jump)))
(match-end 0))
(defun haskell-tng:font:paren-search-forward (limit)
"Match the contents of balanced parenthesis."
(when (re-search-forward "(" limit t)
- (when-let (close (haskell-tng:paren-close))
- (when (<= close limit)
- (re-search-forward (rx (+ anything)) close t)))))
+ (let ((open (point)))
+ (when-let (close (haskell-tng:paren-close))
+ (when (<= close limit)
+ (goto-char open)
+ (re-search-forward (rx (+ anything)) close t))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Here are `function' matchers for use in `font-lock-keywords' and
@@ -312,9 +312,8 @@ succeeds and may further restrict the FIND search limit."
(haskell-tng:font:multiline import
(rx line-start "import" word-end)
(rx line-start "import" word-end
- (+? anything)
- (opt (group "(" (+ anything)))
- (* anything))
+ (+ (not (any ?\( )))
+ (opt "(" (group (+ anything)) ")"))
haskell-tng:indent-close)
(haskell-tng:font:multiline module
- [nongnu] elpa/haskell-tng-mode 6a05d12 090/385: planning for indentation, (continued)
- [nongnu] elpa/haskell-tng-mode 6a05d12 090/385: planning for indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2060f7a 092/385: thoughts on indentation testing, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6d2d764 094/385: skeleton for indentation tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 0d04664 115/385: implement batch compilation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode adb3c50 143/385: better insert indentation suggestions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e79577e 132/385: match ghc source paths when compiling, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8ec4807 145/385: somehow dropped font-lock-extend-region-multiline, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d3a6a22 147/385: no todos in the test/src dir, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 85f20b1 154/385: indent coproducts, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3dbb883 013/385: more progress on multiline type expansion, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c6382e1 036/385: almost got it with imports, then I lost it...,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode f3e3838 070/385: starting to transcribe the expression table, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ceaec13 098/385: groundwork for tab cycling, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8b6d545 178/385: split all the tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4e1f51c 170/385: indent is deriving aware, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3ddafce 181/385: disambiguate -> during lexing, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6b4dca0 189/385: note other build tools, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode cc657a8 197/385: support type alignment options, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a7098e8 194/385: stylish haskell outputs failures, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 21fe2a0 221/385: fix broken test assertions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 907255e 026/385: some namespacing, ELPA Syncer, 2021/10/06