From ee3f85e07515f8700aaabc0184646bd41a8f61c8 Mon Sep 17 00:00:00 2001 From: Sumit Sahrawat Date: Mon, 1 Jun 2015 09:56:11 +0530 Subject: [PATCH] Fix issue #683 Highlighting issues with strings containing double-quotes with backslashes --- haskell-font-lock.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/haskell-font-lock.el b/haskell-font-lock.el index 5bf500e4b..63f40f35b 100644 --- a/haskell-font-lock.el +++ b/haskell-font-lock.el @@ -333,13 +333,17 @@ that should be commented under LaTeX-style literate scripts." ;; This still gets fooled with "'"'"'"'"'"', but ... oh well. ("\\Sw\\('\\)\\([^\\'\n]\\|\\\\.[^\\'\n \"}]*\\)\\('\\)" (1 "\"") (3 "\"")) ;; Deal with instances of `--' which don't form a comment - ("[!#$%&*+./:<=>?@^|~\\-]\\{3,\\}" (0 (cond ((or (nth 3 (syntax-ppss)) (numberp (nth 4 (syntax-ppss)))) - ;; There are no such instances inside nestable comments or strings + ("[!#$%&*+./:<=>?@^|~\\]*--[!#$%&*+./:<=>?@^|~\\-]*" (0 (cond ((or (nth 3 (syntax-ppss)) (numberp (nth 4 (syntax-ppss)))) + ;; There are no such instances inside + ;; nestable comments or strings nil) ((string-match "\\`-*\\'" (match-string 0)) - ;; Sequence of hyphens. Do nothing in + ;; Sequence of hyphens. Do nothing in ;; case of things like `{---'. nil) + ((string-match "\\`[^-]+--.*" (match-string 0)) + ;; Extra characters before comment starts + ".") (t ".")))) ; other symbol sequence ;; Implement Haskell Report 'escape' and 'gap' rules. Backslash