[TableGen] Update editor modes for new keywords.

Summary:
D71407 and 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.

Reviewers: MaskRay, lebedev.ri, plotfi

Reviewed By: lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72693
This commit is contained in:
Simon Tatham 2020-01-14 13:12:16 +00:00
parent 70746136b2
commit 87e348953e
4 changed files with 8 additions and 3 deletions

View File

@ -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))

View File

@ -5,6 +5,9 @@
<list name="keywords">
<item> foreach </item>
<item> field </item>
<item> if </item>
<item> then </item>
<item> else </item>
</list>
<list name="operator-keywords">
<item> in </item>
@ -45,6 +48,7 @@
<item> defm </item>
<item> defset </item>
<item> let </item>
<item> defvar </item>
<item> multiclass </item>
</list>
<list name="class-like">

View File

@ -14,7 +14,7 @@ syntax sync minlines=100
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\+\>/

View File

@ -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>