1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- (setq joy-keywords '("DEFINE" "PUBLIC" "PRIVATE" "LIBRA" "HIDE" "END" "IN"))
- (setq joy-primitives '("unstack" "display" "include" "logical" "integer"
- "string" "choice" "uncons" "infra" "stack" "putch"
- "swap" "cons" "char" "list" "dup" "pop"))
- (setq joy-keywords-regexp (regexp-opt joy-keywords 'words))
- (setq joy-primitives-regexp (regexp-opt joy-primitives 'words))
- (setq joy-font-lock-keywords
- `("==" ";"
- ("\\(\\.\\)[^[:digit:]]" 1)
- ("\\([[:graph:]]+\\)[[:blank:]]*==" 1 font-lock-function-name-face)
- ("'\\\\?[[:alnum:]]\\([[:digit:]][[:digit:]]\\)?" . font-lock-type-face)
- (,joy-keywords-regexp . font-lock-keyword-face)
- (,joy-primitives-regexp . font-lock-builtin-face)))
- (defvar joy-syntax-table nil "Syntax table for `joy-mode'.")
- (setq joy-syntax-table
- (let ((synTable (make-syntax-table)))
-
- (modify-syntax-entry ?# "< b" synTable)
- (modify-syntax-entry ?\n "> b" synTable)
-
- (modify-syntax-entry ?\( ". 1" synTable)
- (modify-syntax-entry ?\) ". 4" synTable)
- (modify-syntax-entry ?* ". 23" synTable)
- synTable))
- (define-derived-mode joy-mode fundamental-mode
- "Joy mode"
- "Major mode for editing the purely functional,
- concatenative programming language Joy."
- :syntax-table joy-syntax-table
- (setq font-lock-defaults '(joy-font-lock-keywords))
- (setq mode-name "joy"))
- (setq joy-keywords nil)
- (setq joy-primitives nil)
- (setq joy-keywords-regexp nil)
- (setq joy-primitives-regexp nil)
- (provide 'joy-mode)
|