[PATCH] D68002: [emacs] simplify and improve keyword highlighting in tablegen-mode.el

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 18:15:21 PDT 2019


inglorion created this revision.
inglorion added reviewers: lattner, MaskRay.
Herald added a project: LLVM.

The keyword and type keyword matchers in tablegen-mode.el checked
for space, newline, tab, or open paren after the regular expression
that matches keywords (or type keywords, respectively). This is
unnecessary, because those regular expressions already include word
boundaries. This change removes the extra check. This also causes
"def" in "def:" to be highlighted as a keyword, which was missed
before.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68002

Files:
  llvm/utils/emacs/tablegen-mode.el


Index: llvm/utils/emacs/tablegen-mode.el
===================================================================
--- llvm/utils/emacs/tablegen-mode.el
+++ llvm/utils/emacs/tablegen-mode.el
@@ -39,10 +39,9 @@
 
      '("^[ \t]*\\(@.+\\)" 1 'td-decorators-face)
      ;; Keywords
-     (cons (concat kw "[ \n\t(]") 1)
-
+     kw
      ;; Type keywords
-     (cons (concat type-kw "[ \n\t(]") 1)
+     type-kw
      ))
   "Additional expressions to highlight in TableGen mode.")
 (put 'tablegen-mode 'font-lock-defaults '(tablegen-font-lock-keywords))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68002.221647.patch
Type: text/x-patch
Size: 545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190925/f16409ae/attachment.bin>


More information about the llvm-commits mailing list