[llvm-commits] [llvm] r53944 - /llvm/trunk/utils/emacs/tablegen-mode.el

Chris Lattner sabre at nondot.org
Tue Jul 22 21:49:21 PDT 2008


Author: lattner
Date: Tue Jul 22 23:49:20 2008
New Revision: 53944

URL: http://llvm.org/viewvc/llvm-project?rev=53944&view=rev
Log:
'Previously, the emacs tablegen mode would highlight constants even if 
they appear in words. This would cause things like the "128" in "VR128"
to be highlighted. This patch fixes the highlighting by only recognizing 
constants when they have word breaks around them.'

Patch by Stefanus Du Toit!

Modified:
    llvm/trunk/utils/emacs/tablegen-mode.el

Modified: llvm/trunk/utils/emacs/tablegen-mode.el
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/emacs/tablegen-mode.el?rev=53944&r1=53943&r2=53944&view=diff

==============================================================================
--- llvm/trunk/utils/emacs/tablegen-mode.el (original)
+++ llvm/trunk/utils/emacs/tablegen-mode.el Tue Jul 22 23:49:20 2008
@@ -26,13 +26,13 @@
      ;; Strings
      '("\"[^\"]+\"" . font-lock-string-face)
      ;; Hex constants
-     '("0x[0-9A-Fa-f]+" . font-lock-preprocessor-face)
+     '("\\<0x[0-9A-Fa-f]+\\>" . font-lock-preprocessor-face)
      ;; Binary constants
-     '("0b[01]+" . font-lock-preprocessor-face)
+     '("\\<0b[01]+\\>" . font-lock-preprocessor-face)
      ;; Integer literals
-     '("[-]?[0-9]+" . font-lock-preprocessor-face)
+     '("\\<[-]?[0-9]+\\>" . font-lock-preprocessor-face)
      ;; Floating point constants
-     '("[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?" . font-lock-preprocessor-face)
+     '("\\<[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?\\>" . font-lock-preprocessor-face)
 
      '("^[ \t]*\\(@.+\\)" 1 'td-decorators-face)
      ;; Keywords





More information about the llvm-commits mailing list