[llvm-branch-commits] [llvm] [emacs] Rework tablegen mode (PR #182076)

Krzysztof Drewniak via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 18 15:04:42 PST 2026


================
@@ -13,40 +15,37 @@
 ;; Create mode-specific tables.
 ;;; Code:
 
-(defvar td-decorators-face 'td-decorators-face
+(defface tablegen-decorators-face
+  '((t :inherit font-lock-function-call-face))
   "Face method decorators.")
-(make-face 'td-decorators-face)
 
 (defvar tablegen-font-lock-keywords
   (let ((kw (regexp-opt '("class" "defm" "def" "field" "include" "in"
-                         "let" "multiclass" "foreach" "if" "then" "else"
-                         "defvar" "defset" "dump" "assert")
+                          "let" "multiclass" "foreach" "if" "then" "else"
+                          "defvar" "defset" "dump" "assert")
                         'words))
         (type-kw (regexp-opt '("bit" "bits" "code" "dag" "int" "list" "string")
-                             'words))
-        )
-    (list
-     ;; Comments
-;;     '("\/\/" . font-lock-comment-face)
-     ;; Strings
-     '("\"[^\"]+\"" . font-lock-string-face)
-     ;; Hex constants
-     '("\\<0x[0-9A-Fa-f]+\\>" . font-lock-preprocessor-face)
-     ;; Binary constants
-     '("\\<0b[01]+\\>" . font-lock-preprocessor-face)
-     ;; Integer literals
-     '("\\<[-]?[0-9]+\\>" . font-lock-preprocessor-face)
-     ;; Floating point constants
-     '("\\<[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?\\>" . font-lock-preprocessor-face)
-
-     '("^[ \t]*\\(@.+\\)" 1 'td-decorators-face)
-     ;; Keywords
-     kw
-     ;; Type keywords
-     type-kw
-     ))
+                             'words)))
+    `(
+      ;; Strings
+      ("\"[^\"]+\"" . font-lock-string-face)
+      ;; Hex constants
+      ("\\<0x[0-9A-Fa-f]+\\>" . font-lock-preprocessor-face)
+      ;; Binary constants
+      ("\\<0b[01]+\\>" . font-lock-preprocessor-face)
+      ;; Integer literals
+      ("\\<[-]?[0-9]+\\>" . font-lock-preprocessor-face)
+      ;; Floating point constants
+      ("\\<[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?\\>" . font-lock-preprocessor-face)
+
+      ("^[ \t]*\\(@.+\\)" 1 'tablegen-decorators-face)
+      ;; Operators
+      ("\\![a-zA-Z]+" . font-lock-function-name-face)
----------------
krzysz00 wrote:

... ok, actually, do you have font-lock-function-name-face set to something?

https://github.com/llvm/llvm-project/pull/182076


More information about the llvm-branch-commits mailing list