Merge branch 'emacs' of http://git.hacks-galore.org/jao/factor
commit
ef4d26cede
|
@ -19,9 +19,6 @@
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
;; BUG: A double quote character on a commented line will break the
|
|
||||||
;; syntax highlighting for that line.
|
|
||||||
|
|
||||||
(defgroup factor nil
|
(defgroup factor nil
|
||||||
"Factor mode"
|
"Factor mode"
|
||||||
:group 'languages)
|
:group 'languages)
|
||||||
|
@ -82,23 +79,35 @@
|
||||||
:type 'hook
|
:type 'hook
|
||||||
:group 'factor)
|
:group 'factor)
|
||||||
|
|
||||||
|
(defconst factor--parsing-words
|
||||||
|
'("{" "}" "^:" "^::" ";" "<<" "<PRIVATE" ">>"
|
||||||
|
"BIN:" "BV{" "B{" "C:" "C-STRUCT:" "C-UNION:" "CHAR:" "CS{" "C{"
|
||||||
|
"DEFER:" "ERROR:" "FORGET:"
|
||||||
|
"GENERIC#" "GENERIC:" "HEX:" "HOOK:" "H{"
|
||||||
|
"IN:" "INSTANCE:" "INTERSECTION:"
|
||||||
|
"M:" "MACRO:" "MACRO::" "MAIN:" "MATH:" "METHOD:" "MIXIN:"
|
||||||
|
"OCT:" "POSTPONE:" "PREDICATE:" "PRIMITIVE:" "PRIVATE>" "PROVIDE:"
|
||||||
|
"REQUIRE:" "REQUIRES:" "SINGLETON:" "SLOT:" "SYMBOL:" "SYMBOLS:"
|
||||||
|
"TUPLE:" "T{" "t\\??" "TYPEDEF:"
|
||||||
|
"UNION:" "USE:" "USING:" "V{" "VAR:" "VARS:" "W{"))
|
||||||
|
|
||||||
|
(defconst factor--regex--parsing-words-ext
|
||||||
|
(regexp-opt '("B" "call-next-method" "delimiter" "f" "flushable" "foldable"
|
||||||
|
"initial:" "inline" "parsing" "read-only" "recursive")
|
||||||
|
'words))
|
||||||
|
|
||||||
(defconst factor-font-lock-keywords
|
(defconst factor-font-lock-keywords
|
||||||
'(("#!.*$" . font-lock-comment-face)
|
`(("#!.*$" . font-lock-comment-face)
|
||||||
("!( .* )" . font-lock-comment-face)
|
("!( .* )" . font-lock-comment-face)
|
||||||
("^!.*$" . font-lock-comment-face)
|
("^!.*$" . font-lock-comment-face)
|
||||||
(" !.*$" . font-lock-comment-face)
|
(" !.*$" . font-lock-comment-face)
|
||||||
("( .* )" . font-lock-comment-face)
|
("( .* )" . font-lock-comment-face)
|
||||||
"BIN:"
|
("\"[^ ][^\"]*\"" . font-lock-string-face)
|
||||||
"MAIN:"
|
("\\(P\\|SBUF\\)\"" 1 font-lock-keyword-face)
|
||||||
"IN:" "USING:" "TUPLE:" "^C:" "^M:"
|
,@(mapcar #'(lambda (w) (cons (concat "\\(^\\| \\)\\(" w "\\)\\($\\| \\)")
|
||||||
"METHOD:"
|
'(2 font-lock-keyword-face)))
|
||||||
"USE:" "REQUIRE:" "PROVIDE:"
|
factor--parsing-words)
|
||||||
"REQUIRES:"
|
(,factor--regex--parsing-words-ext . font-lock-keyword-face)))
|
||||||
"GENERIC:" "GENERIC#" "SYMBOL:" "PREDICATE:" "VAR:" "VARS:"
|
|
||||||
"C-STRUCT:"
|
|
||||||
"C-UNION:" "<PRIVATE" "PRIVATE>" "MACRO:" "MACRO::" "DEFER:" "TYPEDEF:"
|
|
||||||
"SYMBOLS:"
|
|
||||||
))
|
|
||||||
|
|
||||||
(defun factor-indent-line ()
|
(defun factor-indent-line ()
|
||||||
"Indent current line as Factor code"
|
"Indent current line as Factor code"
|
||||||
|
@ -116,7 +125,7 @@
|
||||||
(setq comment-start "! ")
|
(setq comment-start "! ")
|
||||||
(make-local-variable 'font-lock-defaults)
|
(make-local-variable 'font-lock-defaults)
|
||||||
(setq font-lock-defaults
|
(setq font-lock-defaults
|
||||||
'(factor-font-lock-keywords nil nil nil nil))
|
'(factor-font-lock-keywords t nil nil nil))
|
||||||
(set-syntax-table factor-mode-syntax-table)
|
(set-syntax-table factor-mode-syntax-table)
|
||||||
(make-local-variable 'indent-line-function)
|
(make-local-variable 'indent-line-function)
|
||||||
(setq indent-line-function 'factor-indent-line)
|
(setq indent-line-function 'factor-indent-line)
|
||||||
|
|
Loading…
Reference in New Issue