Skip to content

Commit 489bf2d

Browse files
committed
Merge pull request #686 from sumitsahrawat/master
Fix three backslash in string issue, fixes #683
2 parents f58827e + ee3f85e commit 489bf2d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

haskell-font-lock.el

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,17 @@ that should be commented under LaTeX-style literate scripts."
333333
;; This still gets fooled with "'"'"'"'"'"', but ... oh well.
334334
("\\Sw\\('\\)\\([^\\'\n]\\|\\\\.[^\\'\n \"}]*\\)\\('\\)" (1 "\"") (3 "\""))
335335
;; Deal with instances of `--' which don't form a comment
336-
("[!#$%&*+./:<=>?@^|~\\-]\\{3,\\}" (0 (cond ((or (nth 3 (syntax-ppss)) (numberp (nth 4 (syntax-ppss))))
337-
;; There are no such instances inside nestable comments or strings
336+
("[!#$%&*+./:<=>?@^|~\\]*--[!#$%&*+./:<=>?@^|~\\-]*" (0 (cond ((or (nth 3 (syntax-ppss)) (numberp (nth 4 (syntax-ppss))))
337+
;; There are no such instances inside
338+
;; nestable comments or strings
338339
nil)
339340
((string-match "\\`-*\\'" (match-string 0))
340-
;; Sequence of hyphens. Do nothing in
341+
;; Sequence of hyphens. Do nothing in
341342
;; case of things like `{---'.
342343
nil)
344+
((string-match "\\`[^-]+--.*" (match-string 0))
345+
;; Extra characters before comment starts
346+
".")
343347
(t ".")))) ; other symbol sequence
344348

345349
;; Implement Haskell Report 'escape' and 'gap' rules. Backslash

0 commit comments

Comments
 (0)