-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsouffle-mode.el
37 lines (27 loc) · 1.04 KB
/
souffle-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
;;; souffle-mode.el --- Major mode for Souffle datalog files. -*- lexical-binding: t -*-
;; Copyright (C) 2017 Erik Post
;; Author : Erik Post <[email protected]>
;; Homepage : https://github.com/epost/souffle-mode
;; Version : 0.1.0
;; Keywords : languages
;;; Commentary:
;; Emacs integration for Souffle datalog files
;;; Code:
(defconst souffle-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?/ "< 1" table)
(modify-syntax-entry ?/ "< 2" table)
(modify-syntax-entry ?\n "> " table)
table))
(setq souffle-highlights
'((":-\\|=\\|:\\|\\[\\|\\]\\|\\.type\\|\\.decl\\|\\.comp\\|\\.init\\|\\." . font-lock-keyword-face)
("\\number\\|symbol" . font-lock-builtin-face)
(":" . font-lock-constant-face)))
(define-derived-mode souffle-mode fundamental-mode "souffle"
"major mode for editing Souffle datalog files."
:syntax-table souffle-mode-syntax-table
(setq font-lock-defaults '(souffle-highlights))
(setq-local comment-start "\/\/")
(setq-local comment-end "")
)
(provide 'souffle)