So I have defined a set of keywords and constants, and just want to add them to the emacs-lisp-mode syntax highlighting. Here's my work so far:
(defvar chialisp-modules '("mod" "defun" "defun-inline" "defmacro" "defconstant" "include" "lambda"))
(defvar chialisp-keywords '("+" "-" "*" "/" "divmod" "=" ">" ">s" "not" "all" "any" "if" "i" "x" "qq" "unquote" "q" "a" "@" "f" "r" "c" "l" "sha256" "sha256tree" "concat" "strlen" "substr" "logand" "logior" "logxor" "lognot" "ash" "lsh" "point_add" "pubkey_for_exp" "softfork" "list"))
(defvar chialisp-conditions '("REMARK" "AGG_SIG_UNSAFE" "AGG_SIG_ME" "CREATE_COIN" "RESERVE_FEE" "CREATE_COIN_ANNOUNCEMENT" "ASSERT_COIN_ANNOUNCEMENT" "CREATE_PUZZLE_ANNOUNCEMENT" "ASSERT_PUZZLE_ANNOUNCEMENT" "ASSERT_MY_COIN_ID" "ASSERT_MY_PARENT_ID" "ASSERT_MY_ID" "ASSERT_MY_PUZZLEHASH" "ASSERT_MY_AMOUNT" "ASSERT_SECONDS_RELATIVE" "ASSERT_SECONDS_ABSOLUTE" "ASSERT_HEIGHT_RELATIVE" "ASSERT_HEIGHT_ABSOLUTE"))
(defvar chialisp-font-lock-defaults
`((
( ,(regexp-opt chialisp-modules 'words) . font-lock-function-name-face)
( ,(regexp-opt chialisp-keywords 'words) . font-lock-keyword-face)
( ,(regexp-opt chialisp-conditions 'words) . font-lock-constant-face)
)))
(define-derived-mode chialisp-mode emacs-lisp-mode "Chialisp Mode" "Major Mode for chialisp"
(font-lock-add-keywords nil 'chialisp-font-lock-defaults)
)
(add-to-list 'auto-mode-alist '("\\.clvm\\'" . chialisp-mode))
(provide 'chialisp-mode)
I'm not sure where I'm going wrong and have basically been doing trial and error for an hour. Any help would be massively appreciated :)