;; The symbols can come from a JIS0208 font.
(and (fboundp 'make-char) (charsetp 'japanese-jisx0208)
(memq sml-font-lock-symbols '(t japanese-jisx0208))
- (list ;; (cons "\\" (make-char 'japanese-jisx0208 38 75))
+ (list (cons "fn" (make-char 'japanese-jisx0208 38 75))
(cons "->" (make-char 'japanese-jisx0208 34 42))
- ;; (cons "<-" (make-char 'japanese-jisx0208 34 43))
+ (cons "=>" (make-char 'japanese-jisx0208 34 77))
+ (cons "<-" (make-char 'japanese-jisx0208 34 43))
(cons ">=" (make-char 'japanese-jisx0208 33 102))
(cons "<=" (make-char 'japanese-jisx0208 33 101))
- (cons "=>" (make-char 'japanese-jisx0208 34 77))))
+ ;; Some greek letters for type parameters.
+ (cons "'a" (make-char 'japanese-jisx0208 38 65))
+ (cons "'b" (make-char 'japanese-jisx0208 38 66))
+ (cons "'c" (make-char 'japanese-jisx0208 38 67))
+ (cons "'d" (make-char 'japanese-jisx0208 38 68))
+ ))
;; Or a unicode font.
(and (fboundp 'decode-char)
(memq sml-font-lock-symbols '(t unicode))
- (list ;; (cons "\\" (decode-char 'ucs 955))
+ (list (cons "fn" (decode-char 'ucs 955))
+ (cons "o" (decode-char 'ucs 9675))
(cons "->" (decode-char 'ucs 8594))
- ;; (cons "<-" (decode-char 'ucs 8592))
+ (cons "=>" (decode-char 'ucs 8658))
+ (cons "<-" (decode-char 'ucs 8592))
(cons ">=" (decode-char 'ucs 8805))
(cons "<=" (decode-char 'ucs 8804))
- (cons "=>" (decode-char 'ucs 8658))
;; (cons "::" (decode-char 'ucs 8759))
+ ;; Some greek letters for type parameters.
+ (cons "'a" (decode-char 'ucs 945))
+ (cons "'b" (decode-char 'ucs 946))
+ (cons "'c" (decode-char 'ucs 947))
+ (cons "'d" (decode-char 'ucs 948))
))))
(defun sml-font-lock-compose-symbol (alist)
"Compose a sequence of ascii chars into a symbol.
Regexp match data 0 points to the chars."
;; Check that the chars should really be composed into a symbol.
- (let ((start (match-beginning 0))
- (end (match-end 0)))
- (if (or (memq (char-syntax (or (char-before start) ?\ )) '(?. ?\\))
- (memq (char-syntax (or (char-after end) ?\ )) '(?. ?\\))
+ (let* ((start (match-beginning 0))
+ (end (match-end 0))
+ (syntaxes (if (eq (char-syntax (char-after start)) ?w)
+ '(?w) '(?. ?\\))))
+ (if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes)
+ (memq (char-syntax (or (char-after end) ?\ )) syntaxes)
(memq (get-text-property start 'face)
'(font-lock-doc-face font-lock-string-face
font-lock-comment-face)))