change comment
This commit is contained in:
parent
b512575cf7
commit
cb7840d258
28
zre-mode.el
28
zre-mode.el
|
@ -16,11 +16,10 @@
|
|||
;;;
|
||||
|
||||
(defvar zre-keywords
|
||||
'("fn" "to" "in" "is" "as" "use" "if" "else" "default"
|
||||
"for" "try" "catch" "while" "do" "exit" "switch"
|
||||
"return" "const" "type" "this" "yield" "case"
|
||||
"assert" "break" "mod" "not" "and" "or" "print" "let"
|
||||
"band" "bor" "bxor" "srl" "sll")
|
||||
'("fn" "to" "in" "is" "as" "use" "if" "else"
|
||||
"for" "try" "catch" "while" "do" "exit"
|
||||
"return" "const" "type" "this" "yield"
|
||||
"break" "mod" "not" "and" "or" "print" "let")
|
||||
"Keywords in Zre.")
|
||||
|
||||
(defvar zre-types
|
||||
|
@ -70,24 +69,23 @@
|
|||
|
||||
(defvar zre-mode-syntax-table
|
||||
(let ((st (make-syntax-table)))
|
||||
(modify-syntax-entry ?/ ". 124" st)
|
||||
(modify-syntax-entry ?* ". 23" st)
|
||||
;; '/' starts a comment
|
||||
(modify-syntax-entry ?! "<" st)
|
||||
(modify-syntax-entry ?\n ">" st)
|
||||
;; Strings
|
||||
(modify-syntax-entry ?\" "\"" st)
|
||||
(modify-syntax-entry ?` "\"" st))
|
||||
(modify-syntax-entry ?` "\"" st)
|
||||
st)
|
||||
"Syntax table for Zre mode.")
|
||||
|
||||
(define-derived-mode zre-mode prog-mode "Zre"
|
||||
(define-derived-mode zre-mode prog-mode "ZRE"
|
||||
"Major mode for editing Zre code."
|
||||
:syntax-table zre-mode-syntax-table
|
||||
(setq-local font-lock-defaults '(zre-font-lock-keywords))
|
||||
(setq-local comment-start "// ")
|
||||
(setq-local comment-start "! ")
|
||||
(setq-local comment-end "")
|
||||
(setq-local parse-sexp-ignore-comments t)
|
||||
(setq-local indent-line-function 'c-indent-line)
|
||||
(setq-local syntax-propertize-function
|
||||
(syntax-propertize-rules
|
||||
;; Line comments starting with //
|
||||
("\\(//\\)\\(?:[^\n]*\\)" (1 "<")))))
|
||||
(setq-local indent-line-function 'c-indent-line))
|
||||
|
||||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist '("\\.zre\\'" . zre-mode))
|
||||
|
|
Loading…
Reference in New Issue