diff --git a/ztl-mode.el b/ztl-mode.el index a7cc1fb..90708ae 100644 --- a/ztl-mode.el +++ b/ztl-mode.el @@ -28,28 +28,27 @@ ;; Constants (,(regexp-opt ztl-constants 'words) . font-lock-constant-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 - ("-?[0-9]+\\.[0-9]+" . font-lock-constant-face) + ("\\b-?[0-9]+\\.[0-9]+\\b" . font-lock-constant-face) - ;; Ints - ("-?[0-9]+" . font-lock-constant-face) + ;; Integers + ("\\b-?[0-9]+\\b" . font-lock-constant-face) ;; Strings with double quotes ("\"[^\"\n]*\"" . font-lock-string-face) ;; Strings with backticks - ("`[^`]*`" . font-lock-string-face) + ("`[^`]*`" . font-lock-string-face)) - ;; Function definitions - ("\\_\\s-+\\(\\w+\\)(" (1 font-lock-function-name-face)) - - ;; Function calls - ("\\_<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\s-*(" (1 font-lock-function-name-face)) - - ) "Font lock keywords for Ztl mode.") (defvar ztl-mode-syntax-table