-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcoconut-mode.el
70 lines (58 loc) · 2.17 KB
/
coconut-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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
;;; coconut-mode.el --- sample major mode for editing LSL.
;; Copyright © 2015, by Nikita Tchayka
;; Author: Nikita Tchayka ( nikitatchayka@gmail.com )
;; Version: 2.0.13
;; Created: 26 Jun 2015
;; Keywords: languages
;; Homepage: http://github.com/nickseagull/coconut-mode
;; This file is not part of GNU Emacs.
;;; License:
;; You can redistribute this program and/or modify it under the terms of the GNU General Public License version 2.
;;; Commentary:
;; Major mode for Coconut Lang
;;; Code:
(require 'generic-x)
(define-generic-mode
'coconut-mode
'("#")
'("data" "def" "return" "case" "class" "if" "elif" "else" "for" "while" "match" "as" "assert" "break" "continue" "del" "exec" "global" "lambda" "nonlocal" "pass" "print" "with" "yield")
'((" and " . font-lock-keyword-face)
(" in " . font-lock-keyword-face)
(" is " . font-lock-keyword-face)
(" not " . font-lock-keyword-face)
(" or " . font-lock-keyword-face)
("except " . font-lock-warning-face)
("finally " . font-lock-warning-face)
("raise " . font-lock-warning-face)
("try " . font-lock-warning-face)
("from " . font-lock-keyword-face)
("import" . font-lock-keyword-face)
("->" . font-lock-doc-face)
("|>" . font-lock-doc-face)
("|\*>" . font-lock-doc-face)
("<\*|" . font-lock-doc-face)
("<|" . font-lock-doc-face)
("\*" . font-lock-doc-face)
("\*\*" . font-lock-doc-face)
("/" . font-lock-doc-face)
("//" . font-lock-doc-face)
("-" . font-lock-doc-face)
("~" . font-lock-doc-face)
("!=" . font-lock-doc-face)
("<=" . font-lock-doc-face)
(">=" . font-lock-doc-face)
("&" . font-lock-doc-face)
("|" . font-lock-doc-face)
("^" . font-lock-doc-face)
("<<" . font-lock-doc-face)
(">>" . font-lock-doc-face)
("@" . font-lock-doc-face))
'("\\.coco$" "\\.coc$" "\\.coconut$")
nil
"Coconut major mode")
;; add the mode to the `features' list
(provide 'coconut-mode)
;; Local Variables:
;; coding: utf-8
;; End:
;;; coconut-mode.el ends here