llvm.org GIT mirror llvm / ae597a0
[emacs] llvm-mode: fix parens, font-lock i* In llvm-mode, with electric-pair-mode turned on, typing a literal '[' would print out '[[', and '(' would print a '(('. This was a very annoying bug caused by overzealous syntax-table entries: the parens are already part of the '(' and ')' class by default. Fix this. While at it, notice that i32, i64, i1 etc. are not font-locked despite a clear intent to do so. The issue is that regexp-opt doesn't accept regular expressions. So, spell out the common literal integers with different widths. Differential Revision: http://reviews.llvm.org/D7036 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226931 91177308-0d34-0410-b5e6-96231b3b80d8 Ramkumar Ramachandra 4 years ago
1 changed file(s) with 3 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
2222 ;; Unnamed variable slots
2323 '("%[-]?[0-9]+" . font-lock-variable-name-face)
2424 ;; Types
25 `(,(regexp-opt '("void" "i[0-9]+" "float" "double" "type" "label" "opaque") 'words) . font-lock-type-face)
25 `(,(regexp-opt '("void" "i1" "i8" "i16" "i32" "i64" "i128" "float" "double" "type" "label" "opaque") 'words) . font-lock-type-face)
2626 ;; Integer literals
2727 '("\\b[-]?[0-9]+\\b" . font-lock-preprocessor-face)
2828 ;; Floating point constants
8282 ;; word constituents (`w')
8383 ;;[?< "w"]
8484 ;;[?> "w"]
85 [?\% "w"]
85 [?% "w"]
8686 ;;[?_ "w "]
8787 ;; comments
8888 [?\; "< "]
9292 ;; symbol constituents (`_')
9393 ;; punctuation (`.')
9494 ;; open paren (`(')
95 [?\( "("]
96 [?\[ "("]
97 [?\{ "("]
9895 ;; close paren (`)')
99 [?\) ")"]
100 [?\] ")"]
101 [?\} ")"]
10296 ;; string quote ('"')
103 [?\" "\""]
104 ))))
97 [?\" "\""]))))
10598
10699 ;; --------------------- Abbrev table -----------------------------
107100