1
0
forked from alex-eg/sex

sex-mode: add supported keywords, drop chicken-*

This commit is contained in:
2026-10-29 15:01:50 +03:00
parent 1214d118e1
commit 7315694faf

View File

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