(setq lkeywords '("if" "or" "next" "await" "emit" "when"))
(setq lkeywordsr (regexp-opt lkeywords 'words))
(setq font-lock-keywords
`(
(, "#.+" . font-lock-comment-face)
(, "\:\\w+" . font-lock-constant-face)
(, "^\\w+.+" . font-lock-function-name-face)
(, "\".+\"" . font-lock-string-face)
(, "['|!]" . font-lock-negation-char-face)
(, ".[0-9]+" . font-lock-type-face)
(, "[<|>|\+]+" . font-lock-type-face)
(, "(.+)+" . font-lock-type-face)
(, "[\{|\}|\[]+" . font-lock-keyword-face)
(, "]+" . font-lock-keyword-face)
(, lkeywordsr . font-lock-keyword-face)
))
(defun lichen-mode ()
"Major mode for editing lichen DSL"
(interactive)
(kill-all-local-variables)
(set-syntax-table text-mode-syntax-table)
(set (make-local-variable 'font-lock-defaults) '(font-lock-keywords))
(setq major-mode 'lichen-mode)
(setq mode-name "lichen")
(run-hooks 'lichen-mode-hook))
(add-to-list 'auto-mode-alist '("\\.ls\\'" . lichen-mode))
(provide 'lichen-mode)