fix highlighting

This commit is contained in:
zongor 2025-05-17 22:44:35 -04:00
parent d79232d971
commit 4a27058423
1 changed files with 4 additions and 5 deletions

View File

@ -5,7 +5,7 @@
(defvar ztl-keywords (defvar ztl-keywords
'("fn" "to" "in" "is" "as" "use" "set" "if" "else" '("fn" "to" "in" "is" "as" "use" "set" "if" "else"
"for" "loop" "concurrent" "while" "do" "exits" "exit" "for" "loop" "concurrent" "while" "do" "exits" "exit"
"return" "const" "type" "this" "panic" "return" "const" "type" "this" "panic" "yield"
"break" "mod" "not" "and" "or" "print" "let") "break" "mod" "not" "and" "or" "print" "let")
"Keywords in Ztl.") "Keywords in Ztl.")
@ -28,15 +28,15 @@
;; Constants ;; Constants
(,(regexp-opt ztl-constants 'words) . font-lock-constant-face) (,(regexp-opt ztl-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(...)" ;; Function definitions: "fn name(...)"
("\\_<fn\\>\\s-+\\(\\w+\\)(" (1 font-lock-function-name-face)) ("\\_<fn\\>\\s-+\\(\\w+\\)(" (1 font-lock-function-name-face))
;; Function calls: "name(...)" ;; Function calls: "name(...)"
("\\_<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\s-*(" (1 font-lock-function-name-face)) ("\\_<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\s-*(" (1 font-lock-function-name-face))
;; Structs: CamelCase identifiers
("\\b[A-Z][a-zA-Z0-9_]*\\b" . font-lock-type-face)
;; Floating point numbers ;; Floating point numbers
("\\b-?[0-9]+\\.[0-9]+\\b" . font-lock-constant-face) ("\\b-?[0-9]+\\.[0-9]+\\b" . font-lock-constant-face)
@ -50,7 +50,6 @@
("`[^`]*`" . font-lock-string-face)) ("`[^`]*`" . font-lock-string-face))
"Font lock keywords for Ztl mode.") "Font lock keywords for Ztl mode.")
(defvar ztl-mode-syntax-table (defvar ztl-mode-syntax-table
(let ((st (make-syntax-table))) (let ((st (make-syntax-table)))
;; C++-style comments ;; C++-style comments