From 990800e9cfe74e08409f3ccaeccad9fb44e57d2a Mon Sep 17 00:00:00 2001 From: Piturnah Date: Sun, 17 Apr 2022 19:13:27 +0100 Subject: [PATCH 1/2] Update syntax highlighting Highlight `reverse` symbol and switch order of rule functor and apply strategy --- editor/noq-mode.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/editor/noq-mode.el b/editor/noq-mode.el index 6f91cf9..0dd6d2d 100644 --- a/editor/noq-mode.el +++ b/editor/noq-mode.el @@ -56,15 +56,17 @@ ,(regexp-opt noq-keywords 'words) . 'font-lock-keyword-face) ;; `Apply` strategies - (,(format "\\(%s\\)[\t ]*|" (mapconcat 'regexp-quote noq-apply-strategies "\\|")) + (,(format ".*|[\!\t ]*\\(%s\\)" (mapconcat 'regexp-quote noq-apply-strategies "\\|")) 1 'font-lock-type-face) - ("\\([0-9]+\\)[\t ]*|" 1 'font-lock-type-face) + (".*|[\!\t ]*\\([0-9]+\\)" 1 'font-lock-type-face) + ;; Reverse + ("\!" . 'font-lock-keyword-face) ;; Variables ("\\(^\\|[^a-zA-Z0-9_]\\)\\([_A-Z][_a-zA-Z0-9]*\\)" 2 'font-lock-variable-name-face) ;; Functor names - ("\\([^\n\| ]*\\)[\t ]*::" 1 'font-lock-function-name-face) + ("\\([^\n\| ]*\\)[!\t ]*::" 1 'font-lock-function-name-face) )) ;;;###autoload From 0c7c1a62e4482c8fb95c59688cd20dd16c64cc0a Mon Sep 17 00:00:00 2001 From: Piturnah Date: Sun, 17 Apr 2022 19:26:18 +0100 Subject: [PATCH 2/2] Remove erroneous `!` Didn't make a difference, but still annoying. --- editor/noq-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/noq-mode.el b/editor/noq-mode.el index 0dd6d2d..f51a084 100644 --- a/editor/noq-mode.el +++ b/editor/noq-mode.el @@ -66,7 +66,7 @@ ("\\(^\\|[^a-zA-Z0-9_]\\)\\([_A-Z][_a-zA-Z0-9]*\\)" 2 'font-lock-variable-name-face) ;; Functor names - ("\\([^\n\| ]*\\)[!\t ]*::" 1 'font-lock-function-name-face) + ("\\([^\n\| ]*\\)[\t ]*::" 1 'font-lock-function-name-face) )) ;;;###autoload