branch: externals/a68-mode
commit 86c10197052aa936cc6107ae0f28b38f45b6755a
Author: Jose E. Marchesi <jose.march...@oracle.com>
Commit: Jose E. Marchesi <jose.march...@oracle.com>

    a68-font-lock-keywords: fix _ in bold tags and quote faces properly
    
    Also highlight trailing _s in bold tags (which get ignored by both
    Algol 68 Genie and GCC) with a warning face.
    
    Thanks to Stefan Monnier for reporting these problems and for
    suggesting solutions.
---
 a68-mode.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/a68-mode.el b/a68-mode.el
index d936bf1f55..a06fa4afab 100644
--- a/a68-mode.el
+++ b/a68-mode.el
@@ -101,19 +101,21 @@
    (cons (rx word-start
              (eval `(or ,@a68-keywords))
              word-end)
-         'font-lock-keyword-face)
+         ''font-lock-keyword-face)
    (cons (rx word-start
              (eval `(or ,@a68-std-modes))
              word-end)
-         'font-lock-type-face)
+         ''font-lock-type-face)
    (cons (rx word-start
              (or "TRUE" "FALSE")
              word-end)
-         'font-lock-constant-face)
+         ''font-lock-constant-face)
    ;; only valid for bold stropping
-   (cons (concat "\\<[A-Z]+[A-Z_]*\\>") 'font-lock-type-face)
+   '("\\<\\([A-Z]+[A-Z_]*\\>\\)\\(_+\\)?"
+     (1 'font-lock-type-face)
+      (2 'font-lock-warning-face nil t))
    (cons "\\('\\w*'\\)"
-         'font-lock-variable-name-face))
+         ''font-lock-variable-name-face))
   "Highlighting expressions for Algol 68 mode.")
 
 (defun a68-within-string ()

Reply via email to