[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode a808c7b 033/385: notes on language extens
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode a808c7b 033/385: notes on language extensions |
Date: |
Tue, 5 Oct 2021 23:58:56 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit a808c7bae016b12c630bfbb588cb029387da8ef7
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
notes on language extensions
---
haskell-tng-font-lock.el | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/haskell-tng-font-lock.el b/haskell-tng-font-lock.el
index 10831d4..946a300 100644
--- a/haskell-tng-font-lock.el
+++ b/haskell-tng-font-lock.el
@@ -6,7 +6,15 @@
;;; Commentary:
;;
;; A fontification scheme for Haskell with a goal to visually differentiate
-;; between values and types, requiring multi-line analysis.
+;; between values and types.
+;;
+;; It is not possible to be completely accurate for all language extensions.
+;; For example TypeOperators and TypeApplications allow constructs that can
+;; only be disambiguated by semantic rules, e.g. having access to the symbol
+;; table from the imported module.
+;;
+;; If an extension has been considered, but not implemented, the marker EXT
+;; will appear with the extension name near the relevant lines of code.
;;
;; The detection of complex language constructs is not considered, for
;; simplicity and speed. Maybe one day we could use
@@ -14,7 +22,7 @@
;; parsing, but until that day, we do it the idiomatic Emacs way (with hacks
;; and more hacks).
;;
-;; Some very useful tools to assist with keywords and extend-region:
+;; Some useful tools to assist with keywords and extend-region:
;;
;; - https://github.com/Lindydancer/highlight-refontification
;; - https://github.com/Lindydancer/font-lock-profiler
@@ -117,7 +125,11 @@
(1 'haskell-tng:keyword keep)
(2 'haskell-tng:type keep))
- ;; TypeApplications
+ ;; EXT:TypeFamilies (just paint the whole thing)
+
+ ;; TypeApplications: Unfortunately it is not possible to disambiguate
+ ;; between type applications when the following type is in parentheses, as
+ ;; it could also be a value extractor in a pattern.
(,(rx-to-string `(: symbol-start "@" (* space)
(group (opt ,qual) (| ,conid ,consym))))
(1 'haskell-tng:type))
@@ -129,8 +141,8 @@
(,(rx-to-string
`(: line-start "import" (+ space)
(group (opt word-start "qualified" word-end)) (* space)
- ;; TODO PackageImports
- ;; TODO Safe / Trustworthy / Unsafe
+ ;; 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)))))
@@ -140,7 +152,7 @@
(3 'haskell-tng:keyword)
(4 'haskell-tng:keyword))
;; TODO constructors vs types in import brackets
- ;; TODO ExplicitNamespaces
+ ;; EXT:ExplicitNamespaces
)
;; TODO: pragmas
@@ -256,8 +268,8 @@ succeeds and may further restrict the FIND search limit."
;; DeriveAnyClass
;; DerivingStrategies
;; GeneralizedNewtypeDeriving
-;; TODO DerivingVia
-;; TODO StandaloneDeriving
+;; EXT:DerivingVia
+;; EXT:StandaloneDeriving
(haskell-tng:font:multiline deriving
(rx word-start "deriving" word-end)
(rx word-start "deriving" word-end
- [nongnu] elpa/haskell-tng-mode d33d146 060/385: [ci skip] start to refactor layout out of lexer, (continued)
- [nongnu] elpa/haskell-tng-mode d33d146 060/385: [ci skip] start to refactor layout out of lexer, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 12c7148 040/385: leave fontification in comments and strings, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 61f4c09 062/385: [ci skip] unify the testing approach, ELPA Syncer, 2021/10/05
- [nongnu] elpa/haskell-tng-mode 138aca0 089/385: typelevel lists are harder than I thought..., ELPA Syncer, 2021/10/05
- [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 <=
- [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, 2021/10/06
- [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