branch: externals/poke-mode
commit d0de4cfa521a1fd92c5739db0625856134133750
Author: Jose E. Marchesi <[email protected]>
Commit: Jose E. Marchesi <[email protected]>
poke-mode: highlight many field names
2020-11-08 Jose E. Marchesi <[email protected]>
* 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)