From d79232d97189e0d949d7c1411f2f4bcd391f46d9 Mon Sep 17 00:00:00 2001 From: zongor Date: Sat, 17 May 2025 16:32:11 -0400 Subject: [PATCH] fix number mode --- ztl-mode.el | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) 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