From 9c10e789e3e9132b16f301d8a6f3e1d2f1f593f7 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Wed, 25 Sep 2019 18:16:02 +0000 Subject: [PATCH] [emacs] simplify and improve keyword highlighting in tablegen-mode.el Summary: 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. Reviewers: lattner, MaskRay Reviewed By: MaskRay Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68002 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372904 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/emacs/tablegen-mode.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/emacs/tablegen-mode.el b/utils/emacs/tablegen-mode.el index 035455d1b90..edfe2830062 100644 --- a/utils/emacs/tablegen-mode.el +++ b/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)) -- 2.50.1