Function: haskell-lexeme-classify-by-first-char
haskell-lexeme-classify-by-first-char is a natively compiled function
defined in haskell-lexeme.el.
Signature
(haskell-lexeme-classify-by-first-char CHAR)
Documentation
Classify token by CHAR.
CHAR is a character that is assumed to be the first character of a token.
Source Code
;; Defined in /nix/store/9lz2mhw95f9fqxr9mnq46k3f6qz3aq83-emacs-packages-deps/share/emacs/site-lisp/elpa/haskell-mode-20260904.1042/haskell-lexeme.el
(defun haskell-lexeme-classify-by-first-char (char)
"Classify token by CHAR.
CHAR is a character that is assumed to be the first character
of a token."
(let ((category (get-char-code-property (or char ?\ ) 'general-category)))
(cond
((or (member char '(?! ?# ?$ ?% ?& ?* ?+ ?. ?/ ?< ?= ?> ?? ?@ ?^ ?| ?~ ?\\ ?-))
(and (> char 127)
(member category '(Pc Pd Po Sm Sc Sk So))))
'varsym)
((equal char ?:)
'consym)
((equal char ?\')
'char)
((equal char ?\")
'string)
((member category '(Lu Lt))
'conid)
((or (equal char ?_)
(member category '(Ll Lo)))
'varid)
((and (>= char ?0) (<= char ?9))
'number)
((member char '(?\] ?\[ ?\( ?\) ?\{ ?\} ?\` ?\, ?\;))
'special))))