Compare commits
3 Commits
7e689125e2
...
3cff3d479b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cff3d479b | ||
|
|
1af6cb7d50 | ||
|
|
2f56739134 |
@@ -289,4 +289,4 @@ To harness the power of sex-mode, add the following lines to your
|
||||
:upgrade t))
|
||||
#+end_src
|
||||
|
||||
~.sex~ and ~.hsex~ files then open in ~sex-mode~.
|
||||
~.sex~ files then open in ~sex-mode~.
|
||||
|
||||
61
sex-mode.el
61
sex-mode.el
@@ -26,7 +26,7 @@
|
||||
;; :files ("sex-mode.el")
|
||||
;; :upgrade t))
|
||||
;;
|
||||
;; Visiting a .sex or .hsex file turns the mode on.
|
||||
;; Visiting a .sex file turns the mode on.
|
||||
|
||||
;;; Code:
|
||||
|
||||
@@ -59,42 +59,55 @@ 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"
|
||||
"pub"
|
||||
"struct"
|
||||
"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"
|
||||
"goto"
|
||||
"if"
|
||||
"lambda"
|
||||
"map-fields"
|
||||
"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.")
|
||||
|
||||
@@ -134,7 +147,7 @@ Blank lines separate paragraphs. Semicolons start comments.
|
||||
(sex-mode-set-variables))
|
||||
|
||||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist '("\\.\\(sex\\|hsex\\)\\'" . sex-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.sex\\'" . sex-mode))
|
||||
|
||||
(provide 'sex-mode)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user