Skip to content

Commit b428472

Browse files
committed
Merge pull request #471 from gracjan/pr-symbol-syntax-class
Put Haskell symbol chars in punctuation char class.
2 parents fcb48c7 + b53ba49 commit b428472

File tree

1 file changed

+9
-36
lines changed

1 file changed

+9
-36
lines changed

haskell-mode.el

+9-36
Original file line numberDiff line numberDiff line change
@@ -459,55 +459,28 @@ Run M-x describe-variable haskell-mode-hook for a list of such modes."))
459459
(modify-syntax-entry ?\t " " table)
460460
(modify-syntax-entry ?\" "\"" table)
461461
(modify-syntax-entry ?\' "_" table)
462-
(modify-syntax-entry ?_ "w" table)
462+
(modify-syntax-entry ?_ "_" table)
463463
(modify-syntax-entry ?\( "()" table)
464464
(modify-syntax-entry ?\) ")(" table)
465465
(modify-syntax-entry ?\[ "(]" table)
466466
(modify-syntax-entry ?\] ")[" table)
467467

468-
(cond ((featurep 'xemacs)
469-
;; I don't know whether this is equivalent to the below
470-
;; (modulo nesting). -- fx
471-
(modify-syntax-entry ?{ "(}5" table)
472-
(modify-syntax-entry ?} "){8" table)
473-
(modify-syntax-entry ?- "_ 1267" table))
474-
(t
475-
;; In Emacs 21, the `n' indicates that they nest.
476-
;; The `b' annotation is actually ignored because it's only
477-
;; meaningful on the second char of a comment-starter, so
478-
;; on Emacs 20 and before we get wrong results. --Stef
479-
(modify-syntax-entry ?\{ "(}1nb" table)
480-
(modify-syntax-entry ?\} "){4nb" table)
481-
(modify-syntax-entry ?- "_ 123" table)))
468+
(modify-syntax-entry ?\{ "(}1nb" table)
469+
(modify-syntax-entry ?\} "){4nb" table)
470+
(modify-syntax-entry ?- ". 123" table)
482471
(modify-syntax-entry ?\n ">" table)
483472

484-
(let (i lim)
485-
(map-char-table
486-
(lambda (k v)
487-
(when (equal v '(1))
488-
;; The current Emacs 22 codebase can pass either a char
489-
;; or a char range.
490-
(if (consp k)
491-
(setq i (car k)
492-
lim (cdr k))
493-
(setq i k
494-
lim k))
495-
(while (<= i lim)
496-
(when (> i 127)
497-
(modify-syntax-entry i "_" table))
498-
(setq i (1+ i)))))
499-
(standard-syntax-table)))
500-
501473
(modify-syntax-entry ?\` "$`" table)
502474
(modify-syntax-entry ?\\ "\\" table)
503475
(mapc (lambda (x)
504-
(modify-syntax-entry x "_" table))
505-
;; Some of these are actually OK by default.
476+
(modify-syntax-entry x "." table))
506477
"!#$%&*+./:<=>?@^|~")
507478

508-
;; Precise syntax table entries for symbol characters
479+
;; Haskell symbol characters are treated as punctuation because
480+
;; they are not able to form identifiers with word constituent 'w'
481+
;; class characters.
509482
(dolist (charcodes haskell--char-syntax-symbols)
510-
(modify-syntax-entry charcodes "_" table))
483+
(modify-syntax-entry charcodes "." table))
511484
;; ... and for identifier characters
512485
(dolist (charcodes haskell--char-syntax-identifiers)
513486
(modify-syntax-entry charcodes "w" table))

0 commit comments

Comments
 (0)