about summary refs log tree commit diff stats
path: root/rnd/elisp
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2022-12-08 21:08:00 -0500
committerelioat <elioat@tilde.institute>2022-12-08 21:08:00 -0500
commitd75bb5b8b7ad4aa2b289482d10fa07a26ee65721 (patch)
tree58726f47e969a6ba7281fb015b4ab622ec1250a2 /rnd/elisp
parente302178a186f949f858ee798a3afa8a3ea751d59 (diff)
downloaddecember-2022-d75bb5b8b7ad4aa2b289482d10fa07a26ee65721.tar.gz
clean up
Diffstat (limited to 'rnd/elisp')
-rw-r--r--rnd/elisp/lil-mode.el38
1 files changed, 38 insertions, 0 deletions
diff --git a/rnd/elisp/lil-mode.el b/rnd/elisp/lil-mode.el
new file mode 100644
index 0000000..1a88a56
--- /dev/null
+++ b/rnd/elisp/lil-mode.el
@@ -0,0 +1,38 @@
+;;; lil-mode.el --- major mode for editing lil. -*- coding: utf-8; lexical-binding: t; -*-
+
+;; Copyright (c) 2022, by eli_oat
+
+;; Author: eli_oat <hi@eli.li>
+;; Version: 0.0.1
+;; Created: 08 Dec 2022
+;; Keywords: languages
+
+;; This file is not part of GNU Emacs.
+
+;;; License:
+
+;; You can redistribute this program and/or modify it under the terms of the MIT license. 
+
+;;; Commentary:
+
+;; a major mode for writing lil, lil is a programming language by John Earnest.
+;; Learn more about lil, <https://beyondloom.com/decker/lil.html>.
+
+;;; Code:
+
+(add-to-list 'auto-mode-alist '("\\.lil\\'" . lil-mode))
+
+(defconst lil-mode-syntax-table
+  (let ((table (make-syntax-table)))
+    (modify-syntax-entry ?\" "\"" table)   ; " is a string delimiter
+    (modify-syntax-entry ?/ ". 12" table)  ; # starts a comment
+    (modify-syntax-entry ?\n ">" table)    ; \n ends a comment
+    table))
+
+(define-derived-mode lil-mode prog-mode "lil mode"
+  :syntax-table lil-mode-syntax-table
+  (font-lock-fontify-buffer))
+
+(provide 'lil-mode)
+
+;;; lil-mode.el ends here