gdritter repos gelpa / master
Added suppl-mode Getty Ritter 8 years ago
3 changed file(s) with 95 addition(s) and 0 deletion(s). Collapse all Expand all
3434 single
3535 ]
3636 )
37 (suppl-mode .
38 [ (20160518 0000)
39 nil
40 "A simple major mode for editing SUPPL files"
41 single
42 ]
43 )
3744 (telml-mode .
3845 [ (20150904 0000)
3946 nil
2828 <a href="https://github.com/aisamanra/ndbl"><code>ndbl</code></a> configuration files.</li>
2929 <li><code>pico-ml-mode</code> &mdash; minimal major mode for editing
3030 <code>PicoML</code> source files.</li>
31 <li><code>suppl-mode</code> &mdash; minimal major mode for editing
32 <code>SUPPL</code> source files.</li>
3133 <li><code>telml-mode</code> &mdash; minimal major mode for editing
3234 <a href="https://github.com/aisamanra/telml"><code>TeLML</code></a> markup files.</li>
3335 </ul>
1 ;; suppl-mode.el --- a simple major mode for editing suppl files.
2
3 ;; Version: 20160518.0000
4 ;; Author: Getty Ritter
5 ;; Url: http://github.com/aisamanra/suppl-mode
6
7 (defvar suppl-keyword-list nil "list of suppl keywords")
8 (setq suppl-keyword-list
9 '("primitive"
10 "prim"
11 "type"
12 "data"
13 "event"
14 "action"
15 "conflict"
16 "procedure"
17 "proc"
18 "function"
19 "func"
20 "yields"
21 "mode"
22 "table"
23 "index"
24 "key"
25 "lifetime"
26 "handle"
27 "define"
28 "end"
29 "axiom"
30 "lemma"
31 "queue"
32 "insert"
33 "into"
34 "from"
35 "query"
36 "foreach"
37 "skip"))
38
39 (defvar suppl-builtin-list nil "list of suppl builtin identifiers")
40 (setq suppl-builtin-list
41 '("number"
42 "num"
43 "string"
44 "str"
45 "list"
46 "set"
47 "map"
48 "in"
49 "out"
50 "inout"))
51
52 (defvar suppl-font-lock nil
53 "suppl font lock table")
54 (setq suppl-font-lock
55 `(( "\\(%.*\\)$"
56 . font-lock-comment-face )
57 ( ,(regexp-opt suppl-keyword-list)
58 . font-lock-builtin-face )
59 ( ,(regexp-opt suppl-builtin-list)
60 . font-lock-builtin-face )
61 ( "\\([a-z_][A-Za-z0-9_]*\\) *("
62 1 font-lock-function-name-face )
63 ( "\\([A-Z][A-Za-z0-9_]*\\)"
64 . font-lock-variable-name-face )
65 ( "\\([a-z_][A-Za-z0-9_]+\\)"
66 . font-lock-constant-face )))
67
68 (defvar suppl-syntax-table nil
69 "Syntax table for `suppl-mode'.")
70 (setq suppl-syntax-table (make-syntax-table))
71
72 (define-derived-mode suppl-mode prog-mode
73 "suppl-mode is a major mode for editing .eb files"
74 :syntax-table ndbl-syntax-table
75
76 (setq font-lock-defaults '(suppl-font-lock))
77 (setq mode-name "SUPPL mode")
78 (setq comment-start "%")
79 (setq comment-end ""))
80
81 ;;;###autoload
82 (add-to-list 'auto-mode-alist '("\\.suppl\\'" . suppl-mode))
83
84 (provide 'suppl-mode)
85
86 ;;; suppl-mode.el ends here