Skip to content

Commit

Permalink
Merge pull request #682 from gracjan/pr-prevent-keyword-symbols-redef…
Browse files Browse the repository at this point in the history
…inition

Prevent keyword symbols redefinition
  • Loading branch information
gracjan committed May 29, 2015
2 parents 391d4c9 + a4469cd commit 177df9a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions haskell-font-lock.el
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ Returns keywords suitable for `font-lock-keywords'."
(,topdecl-var (1 'haskell-definition-face))
(,topdecl-var2 (2 'haskell-definition-face))
(,topdecl-bangpat (1 'haskell-definition-face))
(,topdecl-sym (2 'haskell-definition-face))
(,topdecl-sym2 (1 'haskell-definition-face))
(,topdecl-sym (2 (unless (member (match-string 2) '("\\" "=" "->" "" "<-" "" "::" "" "," ";" "`"))
'haskell-definition-face)))
(,topdecl-sym2 (1 (unless (member (match-string 1) '("\\" "=" "->" "" "<-" "" "::" "" "," ";" "`"))
'haskell-definition-face)))

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

(,conid 0 'haskell-constructor-face)

(,sym 0 (if (eq (char-after (match-beginning 0)) ?:)
(,sym 0 (if (and (eq (char-after (match-beginning 0)) ?:)
(not (member (match-string 0) '("::" ""))))
'haskell-constructor-face
'haskell-operator-face))))
keywords))
Expand Down

0 comments on commit 177df9a

Please sign in to comment.