forked from alex-eg/sex
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))
|
:upgrade t))
|
||||||
#+end_src
|
#+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")
|
;; :files ("sex-mode.el")
|
||||||
;; :upgrade t))
|
;; :upgrade t))
|
||||||
;;
|
;;
|
||||||
;; Visiting a .sex or .hsex file turns the mode on.
|
;; Visiting a .sex file turns the mode on.
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
@@ -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.")
|
||||||
|
|
||||||
@@ -134,7 +147,7 @@ Blank lines separate paragraphs. Semicolons start comments.
|
|||||||
(sex-mode-set-variables))
|
(sex-mode-set-variables))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(add-to-list 'auto-mode-alist '("\\.\\(sex\\|hsex\\)\\'" . sex-mode))
|
(add-to-list 'auto-mode-alist '("\\.sex\\'" . sex-mode))
|
||||||
|
|
||||||
(provide 'sex-mode)
|
(provide 'sex-mode)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user