emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/poke-mode d0de4cfa52 09/16: poke-mode: highlight many f


From: ELPA Syncer
Subject: [elpa] externals/poke-mode d0de4cfa52 09/16: poke-mode: highlight many field names
Date: Tue, 5 Apr 2022 15:02:55 -0400 (EDT)

branch: externals/poke-mode
commit d0de4cfa521a1fd92c5739db0625856134133750
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Commit: Jose E. Marchesi <jose.marchesi@oracle.com>

    poke-mode: highlight many field names
    
    2020-11-08  Jose E. Marchesi  <jemarch@gnu.org>
    
            * etc/poke-mode.el (poke-field-name): New face.
            (poke-font-lock-keywords): Rule to highlight many field names.
---
 poke-mode.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/poke-mode.el b/poke-mode.el
index 114e2cce31..da662381ae 100644
--- a/poke-mode.el
+++ b/poke-mode.el
@@ -77,6 +77,10 @@
   '((t (:inherit font-lock-variable-name-face)))
   "Face used to highlight declaration names.")
 
+(defface poke-field-name
+  '((t (:inherit font-lock-variable-name-face)))
+  "Face used to highlight field names.")
+
 ;; from libpoke/pkl-lex.l
 (defconst poke-keywords
   '("pinned" "struct" "union" "else" "while" "until" "for" "in" "where" "if"
@@ -198,6 +202,16 @@
           (+? anychar)
           "," (* space) eol)
      1 'poke-declaration-name)
+   ;; Field names
+   `(,(rx (any "A-Z" "a-z" "_" "<" ">" "," "[" "]") (* (any "A-Z" "a-z" "_" 
"0-9"))
+          (+ space)
+          (group (any "A-Z" "a-z" "_") (* (any "A-Z" "a-z" "_" "0-9")))
+          (* space)
+          (opt (or ":" "@") (+? anychar))
+          ";"
+          (* space)
+          eol)
+     1 'poke-field-name)
    ;; attributes
    `(,(rx "'" (group (any "A-Z" "a-z" "_") (* (any "A-Z" "a-z" "0-9" "_"))))
      0 'poke-attribute)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]