From 51c0a2cb9dfc9526cd47e71313f5a745c99cadcc Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Wed, 25 Dec 2019 16:20:18 -0500 Subject: Support highlighting more than one type specifier on a line. --- myrddin-mode.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'myrddin-mode.el') diff --git a/myrddin-mode.el b/myrddin-mode.el index 8ac1862..4e38c2f 100644 --- a/myrddin-mode.el +++ b/myrddin-mode.el @@ -119,12 +119,12 @@ (defvar myrddin-mode-type-specification-regexp (rx - (and (or ?{ "const" "var" "generic") - (zero-or-more (not newline)) - (eval myrddin-mode-identifier-rx) - (zero-or-more whitespace) - ?: - (zero-or-more whitespace) + (and (or (and "->" + (zero-or-more whitespace)) + (and (eval myrddin-mode-identifier-rx) + (zero-or-more whitespace) + ?: + (zero-or-more whitespace))) (group symbol-start (eval myrddin-mode-type-name-rx) @@ -137,7 +137,8 @@ `((,(regexp-opt myrddin-mode-keywords 'symbols) . font-lock-keyword-face) (,(regexp-opt myrddin-mode-constants 'symbols) . font-lock-constant-face) (,myrddin-mode-label-regexp . font-lock-constant-face) - (,myrddin-mode-type-specification-regexp 1 font-lock-type-face) + (,(rx (or ?{ "const" "var" "generic")) ,myrddin-mode-type-specification-regexp + nil nil (1 font-lock-type-face)) (,myrddin-mode-variable-declaration-regexp 1 font-lock-variable-name-face))) -- cgit v1.3