Skip to content

Commit 177df9a

Browse files
committed
Merge pull request #682 from gracjan/pr-prevent-keyword-symbols-redefinition
Prevent keyword symbols redefinition
2 parents 391d4c9 + a4469cd commit 177df9a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

haskell-font-lock.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,10 @@ Returns keywords suitable for `font-lock-keywords'."
253253
(,topdecl-var (1 'haskell-definition-face))
254254
(,topdecl-var2 (2 'haskell-definition-face))
255255
(,topdecl-bangpat (1 'haskell-definition-face))
256-
(,topdecl-sym (2 'haskell-definition-face))
257-
(,topdecl-sym2 (1 'haskell-definition-face))
256+
(,topdecl-sym (2 (unless (member (match-string 2) '("\\" "=" "->" "" "<-" "" "::" "" "," ";" "`"))
257+
'haskell-definition-face)))
258+
(,topdecl-sym2 (1 (unless (member (match-string 1) '("\\" "=" "->" "" "<-" "" "::" "" "," ";" "`"))
259+
'haskell-definition-face)))
258260

259261
;; These four are debatable...
260262
("(\\(,*\\|->\\))" 0 'haskell-constructor-face)
@@ -269,7 +271,8 @@ Returns keywords suitable for `font-lock-keywords'."
269271

270272
(,conid 0 'haskell-constructor-face)
271273

272-
(,sym 0 (if (eq (char-after (match-beginning 0)) ?:)
274+
(,sym 0 (if (and (eq (char-after (match-beginning 0)) ?:)
275+
(not (member (match-string 0) '("::" ""))))
273276
'haskell-constructor-face
274277
'haskell-operator-face))))
275278
keywords))

0 commit comments

Comments
 (0)