Skip to content

Commit 4cd6bea

Browse files
committed
feat: Add LLVM support
1 parent 542f4cc commit 4cd6bea

File tree

5 files changed

+165
-0
lines changed

5 files changed

+165
-0
lines changed

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,3 +534,9 @@
534534
update = none
535535
ignore = dirty
536536
branch = main
537+
[submodule "repos/llvm"]
538+
path = repos/llvm
539+
url = https://github.com/benwilliamgraham/tree-sitter-llvm
540+
update = none
541+
ignore = dirty
542+
branch = main

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## Unreleased
4+
- Add `LLVM` support
45

56
## 0.12.82 - 2023-12-03
67

queries/llvm/highlights.scm

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
(type) @type
2+
(type_keyword) @type.builtin
3+
4+
(type [
5+
(local_var)
6+
(global_var)
7+
] @type)
8+
9+
(argument) @variable.parameter
10+
11+
(_ inst_name: _ @keyword)
12+
13+
[
14+
"catch"
15+
"filter"
16+
] @keyword
17+
18+
[
19+
"to"
20+
"nuw"
21+
"nsw"
22+
"exact"
23+
"unwind"
24+
"from"
25+
"cleanup"
26+
"swifterror"
27+
"volatile"
28+
"inbounds"
29+
"inrange"
30+
] @keyword
31+
(icmp_cond) @keyword
32+
(fcmp_cond) @keyword
33+
34+
(fast_math) @keyword
35+
36+
(_ callee: _ @function)
37+
(function_header name: _ @function)
38+
39+
[
40+
"declare"
41+
"define"
42+
] @keyword.function
43+
(calling_conv) @keyword
44+
45+
[
46+
"target"
47+
"triple"
48+
"datalayout"
49+
"source_filename"
50+
"addrspace"
51+
"blockaddress"
52+
"align"
53+
"syncscope"
54+
"within"
55+
"uselistorder"
56+
"uselistorder_bb"
57+
"module"
58+
"asm"
59+
"sideeffect"
60+
"alignstack"
61+
"inteldialect"
62+
"unwind"
63+
"type"
64+
"global"
65+
"constant"
66+
"externally_initialized"
67+
"alias"
68+
"ifunc"
69+
"section"
70+
"comdat"
71+
"thread_local"
72+
"localdynamic"
73+
"initialexec"
74+
"localexec"
75+
"any"
76+
"exactmatch"
77+
"largest"
78+
"nodeduplicate"
79+
"samesize"
80+
"distinct"
81+
"attributes"
82+
"vscale"
83+
"no_cfi"
84+
] @keyword
85+
86+
(linkage_aux) @keyword
87+
(dso_local) @keyword
88+
(visibility) @keyword
89+
(dll_storage_class) @keyword
90+
(unnamed_addr) @keyword
91+
(attribute_name) @keyword
92+
93+
(function_header [
94+
(linkage)
95+
(calling_conv)
96+
(unnamed_addr)
97+
] @keyword)
98+
99+
(number) @cnumber
100+
(comment) @comment
101+
(string) @string
102+
(cstring) @string
103+
(label) @label
104+
(_ inst_name: "ret" @keyword)
105+
(float) @number
106+
107+
[
108+
(local_var)
109+
(global_var)
110+
] @variable
111+
112+
[
113+
(struct_value)
114+
(array_value)
115+
(vector_value)
116+
] @constructor
117+
118+
[
119+
"("
120+
")"
121+
"["
122+
"]"
123+
"{"
124+
"}"
125+
"<"
126+
">"
127+
"<{"
128+
"}>"
129+
] @punctuation.bracket
130+
131+
[
132+
","
133+
":"
134+
] @punctuation.delimiter
135+
136+
[
137+
"="
138+
"|"
139+
"x"
140+
"..."
141+
] @operator
142+
143+
[
144+
"true"
145+
"false"
146+
] @constant.builtin
147+
148+
[
149+
"undef"
150+
"poison"
151+
"null"
152+
"none"
153+
"zeroinitializer"
154+
] @constant.builtin
155+
156+
(ERROR) @error

repos/llvm

Submodule llvm added at 1b96e58

tree-sitter-langs.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ See `tree-sitter-langs-repos'."
162162
(julia-mode . julia)
163163
(kotlin-mode . kotlin)
164164
(latex-mode . latex)
165+
(llvm-mode . llvm)
165166
(lua-mode . lua)
166167
(makefile-mode . make)
167168
(makefile-automake-mode . make)

0 commit comments

Comments
 (0)