Variable: haskell-lexeme--char-literal-rx

haskell-lexeme--char-literal-rx is a variable defined in haskell-lexeme.el.

Value

"\\(?:\\('\\)\\(?:\\([[:alpha:]_:([]\\)\\('\\)\\|\\(\\\\[^\n][^'\n]*\\|[^[:alpha:]_:(['\n][^'\n]*\\)\\(?:\\('\\)\\|\n\\|\\'\\)\\)\\)"

Documentation

Regexp matching a character literal lookalike.

Note that haskell-lexeme--char-literal-rx matches more than Haskell Report specifies because we want to support also code under edit.

Character literals end with a quote or a newline or end of buffer.

Regexp has subgroup expressions:
 (match-text 1) matches the opening quote.
 (match-text 2) matches the inside of the character literal.
 (match-text 3) matches the closing quote or an empty string
                at the end of line or the end buffer.

Source Code

;; Defined in /nix/store/9lz2mhw95f9fqxr9mnq46k3f6qz3aq83-emacs-packages-deps/share/emacs/site-lisp/elpa/haskell-mode-20260904.1042/haskell-lexeme.el
(defconst haskell-lexeme--char-literal-rx
  (rx-to-string `(: (group "'")
                    (| (: (group (regexp "[[:alpha:]_:([]")) (group "'")) ; exactly one char
                       (: (group (| (regexp "\\\\[^\n][^'\n]*") ; allow quote just after first backslash
                                    (regexp "[^[:alpha:]_:(['\n][^'\n]*")))
                          (| (group "'") "\n" (regexp "\\'"))))))
  "Regexp matching a character literal lookalike.

Note that `haskell-lexeme--char-literal-rx' matches more than
Haskell Report specifies because we want to support also code
under edit.

Character literals end with a quote or a newline or end of
buffer.

Regexp has subgroup expressions:
 (match-text 1) matches the opening quote.
 (match-text 2) matches the inside of the character literal.
 (match-text 3) matches the closing quote or an empty string
                at the end of line or the end buffer.")