Punctuation and keywords

This commit is contained in:
Tony Garnock-Jones 2019-04-25 23:12:24 +01:00
parent 6db903bd37
commit 70888543fa
1 changed files with 40 additions and 25 deletions

View File

@ -33,37 +33,52 @@
"Syntax table in use in preserves-mode buffers.")
;; (modify-syntax-entry ?' "\"" preserves-mode-syntax-table)
(modify-syntax-entry ?_ "_" preserves-mode-syntax-table)
(modify-syntax-entry ?\n "> b" preserves-mode-syntax-table)
(modify-syntax-entry ?\r "> b" preserves-mode-syntax-table)
(modify-syntax-entry ?/ ". 12b" preserves-mode-syntax-table)
(mapcar #'(lambda (x) (modify-syntax-entry x "w" preserves-mode-syntax-table))
'(?- ?_ ?$ ?! ?? ?* ?+ ?~))
(modify-syntax-entry ?/ "_ 12b" preserves-mode-syntax-table)
(mapcar #'(lambda (x) (modify-syntax-entry x "_" preserves-mode-syntax-table))
'(?- ?_ ?$ ?? ?! ?* ?+ ?~ ?: ?< ?> ?=))
(mapcar #'(lambda (x) (modify-syntax-entry x "." preserves-mode-syntax-table))
'(?.))
(defvar preserves-font-lock-keywords
(list
'("\\<\\(~\\|[A-Z]\\)[^[:space:].\n]*\\>" . font-lock-type-face)
'("\\_<\\(~\\|[A-Z]\\)[^[:space:].\n]*\\>" . font-lock-type-face)
'("\\\\[[:space:]]*?\n" . font-lock-warning-face)
(cons (regexp-opt '("->") 'symbols) 'font-lock-builtin-face)
;; (cons (regexp-opt
;; '(
;; "float"
;; "double"
;; "word32"
;; "word64"
;; "integer"
;; "boolean"
;; "text"
;; "set"
;; "list"
;; "dict"
;; "not"
;; "ref"
;; )
;; 'words)
;; 'font-lock-builtin-face)
'("\\." . font-lock-builtin-face)
(cons (regexp-opt '("->"
"<-"
"*"
"+"
"-"
"/"
"<"
">"
"<="
">="
"="
)
'symbols)
'font-lock-builtin-face)
(cons (regexp-opt '(
"coerce"
"match"
"ref"
"value"
)
'words)
'font-lock-builtin-face)
(cons (regexp-opt '(
"block"
"import"
"let"
"namespace"
"try"
"view"
"while"
)
'words)
'font-lock-keyword-face)
))
(defun preserves-mode-variables ()