diff --git a/haskell-lexeme.el b/haskell-lexeme.el index 127bc9450..2bb7b2788 100644 --- a/haskell-lexeme.el +++ b/haskell-lexeme.el @@ -271,7 +271,9 @@ See `haskell-lexeme-classify-by-first-char' for details." (let ((match-data (match-data))) (if (and (equal "[" (match-string-no-properties 0)) (looking-at haskell-lexeme-quasi-quote-literal)) - (if (member (match-string-no-properties 1) '("e" "d" "p" "t")) + (if (or (member (match-string-no-properties 1) '("e" "d" "p" "t")) + (not (equal (haskell-lexeme-classify-by-first-char (char-after (match-beginning 1))) + 'varid))) (progn (set-match-data match-data) 'special) diff --git a/tests/haskell-font-lock-tests.el b/tests/haskell-font-lock-tests.el index 86165d902..1315c51ce 100644 --- a/tests/haskell-font-lock-tests.el +++ b/tests/haskell-font-lock-tests.el @@ -190,6 +190,20 @@ ("%\\" "." haskell-quasi-quote-face) ("Cons" "w" haskell-constructor-face)))) +(ert-deftest haskell-syntactic-quasiquote-constructor () + "Check string escape vs comment escape" + (check-properties + '("[Cons1| Cons2 |]") + '(("Cons1" "w" haskell-constructor-face) + ("Cons2" "w" haskell-constructor-face)))) + +(ert-deftest haskell-syntactic-quasiquote-number () + "Check string escape vs comment escape" + (check-properties + '("[11| Cons2 |]") + '(("1" "w" nil) + ("Cons2" "w" haskell-constructor-face)))) + (ert-deftest haskell-syntactic-test-11a () "Syntax for haddock comments" (check-properties