-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcccatt-mode.el
38 lines (32 loc) · 1.21 KB
/
cccatt-mode.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
;; cccatt-mode.el -- CCCATT major emacs mode
(defvar cccatt-font-lock-keywords
'(
("#.*" . 'font-lock-comment-face)
("\\<\\(let\\|check\\|coh\\|ncoh\\)\\>\\|:\\|=\\|→\\|->\\|×\\|*\\|\\." . font-lock-keyword-face)
;; ("\\<\\(Hom\\|Type\\)\\>\\|->" . font-lock-builtin-face)
;; ("\\<\\(\\)\\>" . font-lock-constant-face)
("\\<let[ \t]+\\([^ (=]*\\)" 1 'font-lock-function-name-face)
("\\<coh[ \t]+\\([^ (=]*\\)" 1 'font-lock-function-name-face)
)
)
(defvar cccatt-mode-syntax-table
(let ((st (make-syntax-table)))
;; Allow some extra characters in words
(modify-syntax-entry ?_ "w" st)
;; Comments
(modify-syntax-entry ?# "<" st)
(modify-syntax-entry ?\n ">" st)
st)
"Syntax table for CCCaTT major mode.")
(defvar cccatt-tab-width 4)
(define-derived-mode cccatt-mode fundamental-mode
"CCCaTT" "Major mode for CCCaTT files."
:syntax-table cccatt-mode-syntax-table
(set (make-local-variable 'comment-start) "#")
(set (make-local-variable 'comment-start-skip) "#+\\s-*")
(set (make-local-variable 'font-lock-defaults) '(cccatt-font-lock-keywords))
(setq mode-name "CCCaTT")
)
(provide 'cccatt-mode)
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.cccatt\\'" . cccatt-mode))