-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproty-mode.el
40 lines (30 loc) · 911 Bytes
/
proty-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
(defvar proty-keywords
'("while" "if" "else" "do" "try" "catch" "end")
"Proty keywords.")
(defvar proty-constants
'("true" "false" "nil")
"Proty constants.")
(defvar proty-keywords-regexp
(regexp-opt proty-keywords 'words))
(defvar proty-constants-regexp
(regexp-opt proty-constants 'words))
;; clear memory
(setq proty-keywords nil)
(setq proty-constants nil)
(setq proty-font-lock-keywords
`(
(,proty-keywords-regexp . font-lock-keyword-face)
(,proty-constants-regexp . font-lock-constant-face)
))
(define-derived-mode proty-mode fundamental-mode
"Proty"
"Major mode for the Proty Programming Language"
(setq font-lock-defaults '((proty-font-lock-keywords)))
;; clear memory
(setq proty-keywords-regexp nil)
(setq proty-constants-regexp nil)
)
;;;###autoload
(setq auto-mode-alist
(cons '("\\.pr" . proty-mode) auto-mode-alist))
(provide 'proty-mode)