fix header, fix comments maybe?

This commit is contained in:
zongor 2025-06-14 18:51:13 -04:00
parent 0ed18154f2
commit b512575cf7
1 changed files with 23 additions and 12 deletions

View File

@ -1,12 +1,26 @@
;;; zre-mode.el --- Major mode for editing Zre code -*- lexical-binding: t; -*- ;;; zre-mode.el --- Major mode for editing Zre code -*- lexical-binding: t; -*-
;; Copyright (C) 2025 zongor
;; ;;
;; Licensed under the GPLv3 License. ;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;;
(defvar zre-keywords (defvar zre-keywords
'("fn" "to" "in" "is" "as" "use" "if" "else" '("fn" "to" "in" "is" "as" "use" "if" "else" "default"
"for" "try" "catch" "while" "do" "exit" "for" "try" "catch" "while" "do" "exit" "switch"
"return" "const" "type" "this" "yield" "return" "const" "type" "this" "yield" "case"
"break" "mod" "not" "and" "or" "print" "let") "assert" "break" "mod" "not" "and" "or" "print" "let"
"band" "bor" "bxor" "srl" "sll")
"Keywords in Zre.") "Keywords in Zre.")
(defvar zre-types (defvar zre-types
@ -53,16 +67,13 @@
("`[^`]*`" . font-lock-string-face)) ("`[^`]*`" . font-lock-string-face))
"Font lock keywords for Zre mode.") "Font lock keywords for Zre mode.")
(defvar zre-mode-syntax-table (defvar zre-mode-syntax-table
(let ((st (make-syntax-table))) (let ((st (make-syntax-table)))
;; C++-style comments (modify-syntax-entry ?/ ". 124" st)
(modify-syntax-entry ?/ ". 14b" st)
;; C-style comments
(modify-syntax-entry ?* ". 23" st) (modify-syntax-entry ?* ". 23" st)
;; Strings
(modify-syntax-entry ?\" "\"" st) (modify-syntax-entry ?\" "\"" st)
(modify-syntax-entry ?` "\"" st) (modify-syntax-entry ?` "\"" st))
st)
"Syntax table for Zre mode.") "Syntax table for Zre mode.")
(define-derived-mode zre-mode prog-mode "Zre" (define-derived-mode zre-mode prog-mode "Zre"