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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
This is unnecessary, because those regular expressions already include word boundaries.
Yes, (regexp-opt ... 'words) includes word boundaries.
Raw type-kw and kw can be used because of this rule in (elisp) Search-based Fontification:
Each element of ‘font-lock-keywords’ should have one of these forms: ‘REGEXP’ Highlight all matches for REGEXP using ‘font-lock-keyword-face’. For example, ;; Highlight occurrences of the word ‘foo’ ;; using ‘font-lock-keyword-face’. "\\<foo\\>" Be careful when composing these regular expressions; a poorly written pattern can dramatically slow things down! The function ‘regexp-opt’ (*note Regexp Functions::) is useful for calculating optimal regular expressions to match several keywords.