From e302178a186f949f858ee798a3afa8a3ea751d59 Mon Sep 17 00:00:00 2001 From: elioat Date: Thu, 8 Dec 2022 20:52:27 -0500 Subject: * --- rnd/lil-mode.el | 55 ++++++++++++------------------------------------------- src/tmp.lil | 2 +- 2 files changed, 13 insertions(+), 44 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, +;; a major mode for writing lil, lil is a programming language by John Earnest. +;; Learn more about lil, . ;;; 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 diff --git a/src/tmp.lil b/src/tmp.lil index b7a26a3..2954867 100644 --- a/src/tmp.lil +++ b/src/tmp.lil @@ -29,7 +29,7 @@ show[a] w:update job:"Amazing Chef" where job = "Chef" from people -show[w] +Show[w] l:insert name:"John" job:"Critic" age:32 into people -- cgit 1.4.1-2-gfad0