Skip to content

Commit c978703

Browse files
committed
Fix double negation issue in dot fontification
1 parent c1396e4 commit c978703

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

haskell-font-lock.el

+2-4
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,8 @@ like ::, class, instance, data, newtype, type."
304304
(conid (if (get-text-property (match-beginning 0) 'haskell-type)
305305
'haskell-type-face
306306
'haskell-constructor-face))
307-
(varsym (when (and (not (member (match-string 0) '("-" "+" ".")))
308-
(not (save-excursion
309-
(goto-char (match-beginning 1))
310-
(looking-at-p "\\sw"))))
307+
(varsym (unless (and (member (match-string 0) '("-" "+" "."))
308+
(equal (string-to-syntax "w") (syntax-after (match-beginning 0))))
311309
;; We need to protect against the case of
312310
;; plus, minus or dot inside a floating
313311
;; point number.

tests/haskell-font-lock-tests.el

+2
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
" 9.9'r'" ; (9.9,'r')
269269
" 's'12e-34" ; ('s',1.2e-33)
270270
" 't'56.78" ; ('t',56.78)
271+
" ."
271272
)
272273
'(("'a'" t font-lock-string-face)
273274
("'b'" t font-lock-string-face)
@@ -294,6 +295,7 @@
294295
("12e-34" t nil)
295296
("'t'" t font-lock-string-face)
296297
("56.78" t nil)
298+
("." t haskell-operator-face)
297299
)))
298300

299301

0 commit comments

Comments
 (0)