sex-mode: add supported keywords, drop chicken-*
All checks were successful
Sex CI / build-linux (pull_request) Successful in 5m33s

This commit is contained in:
2026-10-29 15:01:50 +03:00
parent 37fcfd376c
commit bd9929d9c5

View File

@@ -59,42 +59,55 @@ All commands in `lisp-mode-shared-map' are inherited by this map.")
(defconst sex-font-lock-keywords (defconst sex-font-lock-keywords
(eval-when-compile (eval-when-compile
(list (list
;; Declarations ;; Declarations. `pub' and `extern' are optional prefixes, so
;; `(pub fn main' highlights both keywords and the name.
(list (concat "(" (list (concat "("
(regexp-opt '("chicken-define" "\\(?:\\(pub\\|extern\\)[[:space:]]+\\)?"
"chicken-define-syntax" (regexp-opt '("define"
"chicken-import"
"chicken-load"
"define"
"defmacro" "defmacro"
"extern" "enum"
"fn"
"import" "import"
"include" "include"
"fn"
"pub"
"struct" "struct"
"var" "typedef"
"union") "union"
'word) "var")
"\\>" 'words)
"[[:space:]]*" "[[:space:]]*"
"\\([[:word:]]*\\)") "\\([[:word:]]*\\)")
'(1 font-lock-keyword-face) '(1 font-lock-keyword-face nil t)
'(2 font-lock-function-name-face)) '(2 font-lock-keyword-face)
;; Keywords '(3 font-lock-function-name-face nil t))
;; Statement and expression heads, plus the macro-language forms
;; that appear in `defmacro' bodies.
(list (concat "(" (list (concat "("
(regexp-opt '("do" (regexp-opt '("break"
"c-bit-or"
"c-bit-or="
"c-or"
"case" "case"
"case/fallthrough"
"cast"
"closure"
"continue"
"default" "default"
"if" "do"
"else"
"for" "for"
"goto" "goto"
"if"
"lambda"
"map-fields"
"return" "return"
"sizeof"
"static-assert"
"switch" "switch"
"var" "type-match"
"while") "type-of"
'word) "while"
"\\>") ":")
'words))
'(1 font-lock-builtin-face)))) '(1 font-lock-builtin-face))))
"Font-lock keywords for Sex mode.") "Font-lock keywords for Sex mode.")