diff options
author | elioat <elioat@tilde.institute> | 2022-12-08 20:52:27 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2022-12-08 20:52:27 -0500 |
commit | e302178a186f949f858ee798a3afa8a3ea751d59 (patch) | |
tree | 570a152fd8c7ca968f55dc858cb99f26c23f5ab0 /rnd | |
parent | 1f67d723fc0cbbc25b4b1cb61b7fd61bb63334ef (diff) | |
download | december-2022-e302178a186f949f858ee798a3afa8a3ea751d59.tar.gz |
*
Diffstat (limited to 'rnd')
-rw-r--r-- | rnd/lil-mode.el | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/rnd/lil-mode.el b/rnd/lil-mode.el index b6052ef..1a88a56 100644 --- a/rnd/lil-mode.el +++ b/rnd/lil-mode.el @@ -11,59 +11,28 @@ ;;; License: -;; You can redistribute this program and/or modify it under the terms of the GNU General Public License version 2. +;; 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, <https://beyondloom.com/decker/lil.html> +;; 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)) -(setq lil-highlights - '(("Sin\\|Cos\\|Sum" . 'font-lock-function-name-face) - ("Pi\\|Infinity" . 'font-lock-constant-face))) +(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 fundamental-mode "lil" - "major mode for editing lil." - (setq font-lock-defaults '(lil-highlights))) +(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 - - -;; font-lock-builtin-face -;; font-lock-comment-face -;; font-lock-constant-face -3;; font-lock-function-name-face -;; font-lock-keyword-face -;; font-lock-negation-char-face -;; font-lock-reference-face -;; font-lock-string-face -;; font-lock-type-face -;; font-lock-variable-name-face -;; font-lock-preprocessor-face - - - - -;; syn match lilComment "#.*$" -;; syn match lilEsc contained /\\[n"\\]/ -;; syn region lilStr start=/"/ end=/"/ skip=/\\"/ contains=lilEsc - -;; syn match lilName contained /[_?a-zA-Z][_?a-zA-Z0-9]*/ -;; syn keyword lilOn on nextgroup=lilName skipwhite - -;; syn keyword lilControl if else end while each send do select extract update insert into from where by orderby asc desc with local -;; syn keyword lilPrims floor cos sin tan exp ln sqrt count sum min max raze first last range list table rows cols mag unit heading -;; syn keyword lilPrims split fuse cat dict take drop in at join cross parse format typeof unless flip limit - -;; hi def link lilComment Comment -;; hi def link lilName Function -;; hi def link lilEsc SpecialChar -;; hi def link lilStr String -;; hi def link lilOn Statement -;; hi def link lilControl Repeat -;; hi def link lilPrims Operator |