Skip to content

Commit

Permalink
feat: Add Tablegen support (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 authored Dec 9, 2023
1 parent b9a7d91 commit caad022
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@
update = none
ignore = dirty
branch = main
[submodule "repos/tablegen"]
path = repos/tablegen
url = https://github.com/Flakebi/tree-sitter-tablegen
update = none
ignore = dirty
branch = master
[submodule "repos/llvm-mir"]
path = repos/llvm-mir
url = https://github.com/Flakebi/tree-sitter-llvm-mir
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased
- Add `LLVM Tablegen` support
- Add `LLVM MIR` support

## 0.12.84 - 2023-12-09
Expand Down
90 changes: 90 additions & 0 deletions queries/tablegen/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[
(comment)
(multiline_comment)
] @comment

[
"("
")"
"["
"]"
"{"
"}"
"<"
">"
] @punctuation.bracket

[
","
";"
"."
] @punctuation.delimiter

[
"#"
"-"
"..."
":"
] @operator

[
"="
"!cond"
(operator_keyword)
] @function

[
"true"
"false"
] @constant.builtin.boolean

[
"?"
] @constant.builtin

(var) @variable

(template_arg (identifier) @variable.parameter)

(_ argument: (value (identifier) @variable.parameter))

(type) @type

"code" @type.builtin

(number) @constant.numeric.integer
[
(string_string)
(code_string)
] @string

(preprocessor) @keyword.directive

[
"class"
"field"
"let"
"defvar"
"def"
"defset"
"defvar"
"assert"
] @keyword

[
"let"
"in"
"foreach"
"if"
"then"
"else"
] @keyword.operator

"include" @keyword.control.import

[
"multiclass"
"defm"
] @namespace

(ERROR) @error
1 change: 1 addition & 0 deletions repos/tablegen
Submodule tablegen added at 568dd8
1 change: 1 addition & 0 deletions tree-sitter-langs.el
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ See `tree-sitter-langs-repos'."
(smithy-mode . smithy)
(sql-mode . sql)
(swift-mode . swift)
(tablegen-mode . tablegen)
(toml-mode . toml)
(conf-toml-mode . toml)
(tcl-mode . tcl)
Expand Down

0 comments on commit caad022

Please sign in to comment.