[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 47f1f9f 180/385: lex CONSYM correctly
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 47f1f9f 180/385: lex CONSYM correctly |
Date: |
Tue, 5 Oct 2021 23:59:27 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 47f1f9fd88eb3adef44dcf5bda16a31dfc5e7de6
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
lex CONSYM correctly
---
haskell-tng-lexer.el | 10 ++++++++--
haskell-tng-smie.el | 13 ++++++-------
test/src/layout.hs.lexer | 2 +-
test/src/medley.hs.lexer | 4 ++--
4 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/haskell-tng-lexer.el b/haskell-tng-lexer.el
index 8ea1a68..b7da5f7 100644
--- a/haskell-tng-lexer.el
+++ b/haskell-tng-lexer.el
@@ -96,7 +96,10 @@ the lexer."
;; reserved keywords take precedence
((looking-at haskell-tng:regexp:reserved-hack)
- (haskell-tng-lexer:last-match))
+ (pcase (haskell-tng-lexer:last-match)
+ (":" "CONSYM")
+ ("':" "KINDSYM") ;; DataKinds
+ (other other)))
;; syntax tables (supported by `smie-indent-forward-token')
((looking-at haskell-tng-lexer:fast-syntax) nil)
@@ -164,7 +167,10 @@ the lexer."
((bobp) nil)
((looking-back haskell-tng:regexp:reserved-hack
(max lbp (- (point) 8)) 't)
- (haskell-tng-lexer:last-match 'reverse))
+ (pcase (haskell-tng-lexer:last-match 'reverse)
+ (":" "CONSYM")
+ ("':" "KINDSYM") ;; DataKinds
+ (other other)))
((looking-back haskell-tng-lexer:fast-syntax
(max lbp (- (point) 1)))
nil)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 8375515..a340f72 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -95,9 +95,8 @@ foobar1 ::
;; operators all have the same precedence
(infixexp
- ;; TODO : and ': should lex as SYMID
- (id ":" infixexp) ;; keyword infix
- (id "':" infixexp) ;; DataKinds
+ (id "KINDSYM" infixexp)
+ (id "CONSYM" infixexp)
(id "SYMID" infixexp))
(data
@@ -256,7 +255,7 @@ information, to aid in the creation of new rules."
(:list-intro
(pcase arg
- ((or "<-" "SYMID") t)
+ ((or "<-" "SYMID" "CONSYM" "KINDSYM") t)
))
(:after
@@ -272,7 +271,7 @@ information, to aid in the creation of new rules."
2)
("::" 5)
("," (smie-rule-separator method))
- ((or "SYMID")
+ ((or "SYMID" "CONSYM" "KINDSYM")
(if (smie-rule-hanging-p) 2 (smie-rule-parent)))
))
@@ -288,7 +287,7 @@ information, to aid in the creation of new rules."
;;
;; blah = bloo where
;; bloo = blu
- ((or "where" "let" "do" "case" "=" "->" "SYMID")
+ ((or "where" "let" "do" "case" "=" "->" "SYMID" "CONSYM" "KINDSYM")
(smie-rule-parent))
("\\case" ;; LambdaCase
(smie-rule-parent))
@@ -304,7 +303,7 @@ information, to aid in the creation of new rules."
;; heuristic works in most cases, but is not robust.
(smie-rule-parent -2)
(smie-rule-separator method)))
- ((guard (smie-rule-parent-p "SYMID"))
+ ((guard (smie-rule-parent-p "SYMID" "CONSYM" "KINDSYM"))
(smie-rule-parent))
))
diff --git a/test/src/layout.hs.lexer b/test/src/layout.hs.lexer
index 4128c01..e523ca9 100644
--- a/test/src/layout.hs.lexer
+++ b/test/src/layout.hs.lexer
@@ -9,7 +9,7 @@ module CONID « CONID , VARID , VARID , VARID , VARID » where
; VARID :: CONID VARID -> CONID
; VARID VARID = VARID « VARID VARID » where
{ VARID CONID = []
-; VARID « CONID VARID VARID » = VARID : VARID where { VARID = VARID VARID
+; VARID « CONID VARID VARID » = VARID CONSYM VARID where { VARID = VARID VARID
} } ; VARID :: CONID VARID -> « VARID , CONID VARID »
; VARID « CONID VARID VARID »
diff --git a/test/src/medley.hs.lexer b/test/src/medley.hs.lexer
index 0a2047f..b391454 100644
--- a/test/src/medley.hs.lexer
+++ b/test/src/medley.hs.lexer
@@ -51,10 +51,10 @@ VARID , VARID , VARID »
; class CONID VARID VARID where
{ VARID :: CONID VARID -> VARID
-} ; instance CONID VARID « VARID ': VARID » where
+} ; instance CONID VARID « VARID KINDSYM VARID » where
{ VARID « CONID VARID _ » = VARID
-} ; instance CONID VARID VARID => CONID VARID « VARID ': VARID » where
+} ; instance CONID VARID VARID => CONID VARID « VARID KINDSYM VARID » where
{ VARID « CONID _ VARID » = VARID VARID
} ; data CONID = CONID
- [nongnu] elpa/haskell-tng-mode ce17d96 376/385: new hsinspect release, (continued)
- [nongnu] elpa/haskell-tng-mode ce17d96 376/385: new hsinspect release, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode eb6b487 357/385: test fqn-at-point and fix a longstanding bug, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 103e758 325/385: expose some more hsinspect-0.0.8 index info, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 374835c 355/385: a test for interactive commands, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e3c6dc6 336/385: follow re-exports, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9904e72 366/385: jump-to-definition works inside the project, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1c68e79 381/385: requires emacs 27, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 55d8e69 385/385: upgrade hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 97e4a66 379/385: bump hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3870bf1 367/385: time to remove the cabal v2- prefixes, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 47f1f9f 180/385: lex CONSYM correctly,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 9bc086a 187/385: easier install, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4f40db3 218/385: fast-tags is stack compatible by default, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 59640ce 234/385: cleanups thanks to MELPA review, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 35d3830 306/385: cache improvements, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c0b1b6b 301/385: change the compile-always-ask default, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 907c8fa 153/385: ImplicitParams indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ca00f1f 183/385: thot, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 611711a 208/385: address melpa review, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 89c5c80 223/385: improve smartparens workaround, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e270647 228/385: more robust calls to hsinspect, ELPA Syncer, 2021/10/06