diff --git a/README.org b/README.org index 83aa845..4143fc9 100644 --- a/README.org +++ b/README.org @@ -1,7 +1,9 @@ #+OPTIONS: toc:nil -* zrl-mode +* undar-mode :PROPERTIES: -:CUSTOM_ID: zrl-mode +:CUSTOM_ID: undar-mode :END: -ZRL mode for Emacs +UNDAR is statically-typed permacomputing-oriented language for the purpose of creating 1st generation style 3D video and graphical user interfaces that work on constrained systems, microcontrollers, retro consoles, and the web using emscripten. It is the language that controls the Reality Engine a 32 bit CISC-like register-based VM written in C89. + +This is a major mode for Emacs diff --git a/zrl-mode.el b/undar-mode.el similarity index 69% rename from zrl-mode.el rename to undar-mode.el index 79c4580..c7aff4f 100644 --- a/zrl-mode.el +++ b/undar-mode.el @@ -1,4 +1,4 @@ -;;; zrl-mode.el --- Major mode for editing Zrl code -*- lexical-binding: t; -*- +;;; undar-mode.el --- Major mode for editing Undar code -*- lexical-binding: t; -*- ;; Copyright (C) 2025 zongor ;; ;; This program is free software: you can redistribute it and/or modify @@ -15,41 +15,41 @@ ;; along with this program. If not, see . ;;; -(defvar zrl-keywords +(defvar undar-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") - "Keywords in Zrl.") + "Keywords in Undar.") -(defvar zrl-types +(defvar undar-types '("byte" "str" "real" "bool" "int" "nat" "f32" "f64" "u8" "u16" "u32" "u64" "i8" "i16" "i32" "i64") - "Types in Zrl.") + "Types in Undar.") -(defvar zrl-constants +(defvar undar-constants '("true" "false" "nil") - "Constants in Zrl.") + "Constants in Undar.") -(defvar zrl-font-lock-keywords +(defvar undar-font-lock-keywords `( ;; Keywords - (,(regexp-opt zrl-keywords 'words) . font-lock-keyword-face) + (,(regexp-opt undar-keywords 'words) . font-lock-keyword-face) ;; Types - (,(regexp-opt zrl-types 'words) . font-lock-type-face) + (,(regexp-opt undar-types 'words) . font-lock-type-face) ;; Constants - (,(regexp-opt zrl-constants 'words) . font-lock-constant-face) + (,(regexp-opt undar-constants 'words) . font-lock-constant-face) ;; Structs: CamelCase identifiers ("\\b[A-Z][a-zA-Z0-9_]*\\b" . font-lock-type-face) ;; Function definitions: "fn name(...)" - ("\\_\\s-+\\(\\w+\\)(" (1 font-lock-function-name-face)) + ("\\_\\s-+\\(\\w+\\)(" (1 font-lock-function-name-face)) ;; Function calls: "name(...)" ("\\_<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\s-*(" (1 font-lock-function-name-face)) @@ -66,9 +66,9 @@ ;; Strings with backticks ("`[^`]*`" . font-lock-string-face)) - "Font lock keywords for Zrl mode.") + "Font lock keywords for Undar mode.") -(defvar zrl-mode-syntax-table +(defvar undar-mode-syntax-table (let ((st (make-syntax-table))) ;; '/' starts a comment (modify-syntax-entry ?! "<" st) @@ -77,19 +77,19 @@ (modify-syntax-entry ?\" "\"" st) (modify-syntax-entry ?` "\"" st) st) - "Syntax table for Zrl mode.") + "Syntax table for Undar mode.") -(define-derived-mode zrl-mode prog-mode "ZRL" - "Major mode for editing Zrl code." - :syntax-table zrl-mode-syntax-table - (setq-local font-lock-defaults '(zrl-font-lock-keywords)) +(define-derived-mode undar-mode prog-mode "UNDAR" + "Major mode for editing Undar code." + :syntax-table undar-mode-syntax-table + (setq-local font-lock-defaults '(undar-font-lock-keywords)) (setq-local comment-start "! ") (setq-local comment-end "") (setq-local parse-sexp-ignore-comments t) (setq-local indent-line-function 'c-indent-line)) ;;;###autoload -(add-to-list 'auto-mode-alist '("\\.zrl\\'" . zrl-mode)) +(add-to-list 'auto-mode-alist '("\\.undar\\'" . undar-mode)) -(provide 'zrl-mode) -;;; zrl-mode.el ends here +(provide 'undar-mode) +;;; undar-mode.el ends here