diff --git a/ztl-mode.el b/ztl-mode.el index 90708ae..4a07679 100644 --- a/ztl-mode.el +++ b/ztl-mode.el @@ -5,7 +5,7 @@ (defvar ztl-keywords '("fn" "to" "in" "is" "as" "use" "set" "if" "else" "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") "Keywords in Ztl.") @@ -28,15 +28,15 @@ ;; Constants (,(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(...)" ("\\_\\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)) - ;; Structs: CamelCase identifiers - ("\\b[A-Z][a-zA-Z0-9_]*\\b" . font-lock-type-face) - ;; Floating point numbers ("\\b-?[0-9]+\\.[0-9]+\\b" . font-lock-constant-face) @@ -50,7 +50,6 @@ ("`[^`]*`" . font-lock-string-face)) "Font lock keywords for Ztl mode.") - (defvar ztl-mode-syntax-table (let ((st (make-syntax-table))) ;; C++-style comments