[PATCH] D72693: [TableGen] Update editor modes for new keywords.
Simon Tatham via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 14 04:39:25 PST 2020
simon_tatham created this revision.
simon_tatham added reviewers: MaskRay, lebedev.ri, plotfi.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
D71407 <https://reviews.llvm.org/D71407> and D71474 <https://reviews.llvm.org/D71474> added new keywords to the Tablegen language:
`defvar`, `if`, `then` and `else`. This commit updates the various
editor modes to highlight them appropriately.
Some of the modes also didn't include `defset`, so I've added that too
while I was there.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72693
Files:
llvm/utils/emacs/tablegen-mode.el
llvm/utils/kate/llvm-tablegen.xml
llvm/utils/vim/syntax/tablegen.vim
llvm/utils/vscode/tablegen/syntaxes/TableGen.tmLanguage
Index: llvm/utils/vscode/tablegen/syntaxes/TableGen.tmLanguage
===================================================================
--- llvm/utils/vscode/tablegen/syntaxes/TableGen.tmLanguage
+++ llvm/utils/vscode/tablegen/syntaxes/TableGen.tmLanguage
@@ -18,7 +18,7 @@
</dict>
<dict>
<key>match</key>
- <string>\b(def|let|in|code|dag|string|list|bits|bit|field|include|defm|foreach|class|multiclass|int)\b</string>
+ <string>\b(def|let|in|code|dag|string|list|bits|bit|field|include|defm|foreach|class|multiclass|int|defvar|defset|if|then|else)\b</string>
<key>name</key>
<string>keyword.control.tablegen</string>
</dict>
Index: llvm/utils/vim/syntax/tablegen.vim
===================================================================
--- llvm/utils/vim/syntax/tablegen.vim
+++ llvm/utils/vim/syntax/tablegen.vim
@@ -14,7 +14,7 @@
syn case match
-syn keyword tgKeyword def let in code dag field include defm foreach
+syn keyword tgKeyword def let in code dag field include defm foreach defset defvar if then else
syn keyword tgType class int string list bit bits multiclass
syn match tgNumber /\<\d\+\>/
Index: llvm/utils/kate/llvm-tablegen.xml
===================================================================
--- llvm/utils/kate/llvm-tablegen.xml
+++ llvm/utils/kate/llvm-tablegen.xml
@@ -5,6 +5,10 @@
<list name="keywords">
<item> foreach </item>
<item> field </item>
+ <item> if </item>
+ <item> then </item>
+ <item> else </item>
+ <item> defvar </item>
</list>
<list name="operator-keywords">
<item> in </item>
Index: llvm/utils/emacs/tablegen-mode.el
===================================================================
--- llvm/utils/emacs/tablegen-mode.el
+++ llvm/utils/emacs/tablegen-mode.el
@@ -18,7 +18,8 @@
(defvar tablegen-font-lock-keywords
(let ((kw (regexp-opt '("class" "defm" "def" "field" "include" "in"
- "let" "multiclass" "foreach")
+ "let" "multiclass" "foreach" "if" "then" "else"
+ "defvar" "defset")
'words))
(type-kw (regexp-opt '("bit" "bits" "code" "dag" "int" "list" "string")
'words))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72693.237937.patch
Type: text/x-patch
Size: 2262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200114/eeafb175/attachment.bin>
More information about the llvm-commits
mailing list