There is no EndPtr anymore - reinterpret the original comment in terms
[oota-llvm.git] / utils / emacs / tablegen-mode.el
index 08f7f252c681ecd8e3c04f0c6a75ca66fadd79b4..3853ce66a2850ad6d560a01f9c27e691cdd45677 100644 (file)
 (make-face 'td-decorators-face)
 
 (defvar tablegen-font-lock-keywords
-  (let ((kw (mapconcat 'identity
-                       '("class" "defm" "def" "field" "include" "in"
+  (let ((kw (regexp-opt '("class" "defm" "def" "field" "include" "in"
                          "let" "multiclass")
-                       "\\|"))
-        (type-kw (mapconcat 'identity
-                            '("bit" "bits" "code" "dag" "int" "list" "string")
-                            "\\|"))
+                        'words))
+        (type-kw (regexp-opt '("bit" "bits" "code" "dag" "int" "list" "string")
+                             'words))
         )
     (list
      ;; Comments
 
      '("^[ \t]*\\(@.+\\)" 1 'td-decorators-face)
      ;; Keywords
-     (cons (concat "\\<\\(" kw "\\)\\>[ \n\t(]") 1)
+     (cons (concat kw "[ \n\t(]") 1)
 
      ;; Type keywords
-     (cons (concat "\\<\\(" type-kw "\\)[ \n\t(]") 1)
+     (cons (concat type-kw "[ \n\t(]") 1)
      ))
   "Additional expressions to highlight in TableGen mode.")
 (put 'tablegen-mode 'font-lock-defaults '(tablegen-font-lock-keywords))
         )
 
   (set-syntax-table tablegen-mode-syntax-table)
+  (make-local-variable 'comment-start)
+  (setq comment-start "//")
   (run-hooks 'tablegen-mode-hook))       ; Finally, this permits the user to
                                          ;   customize the mode with a hook.