aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/llvm
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-06-12 09:54:30 -0600
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commit692b051b09935653befdb8f7ba8afdb640adf17b (patch)
tree167162b6b129ae04f68c5735078521a72917c742 /runtime/queries/llvm
parentfeat(c-family): inherit injections (diff)
downloadnvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'runtime/queries/llvm')
-rw-r--r--runtime/queries/llvm/highlights.scm180
-rw-r--r--runtime/queries/llvm/injections.scm2
2 files changed, 182 insertions, 0 deletions
diff --git a/runtime/queries/llvm/highlights.scm b/runtime/queries/llvm/highlights.scm
new file mode 100644
index 000000000..ea48272f5
--- /dev/null
+++ b/runtime/queries/llvm/highlights.scm
@@ -0,0 +1,180 @@
+[
+ (local_var)
+ (global_var)
+] @variable
+
+(type) @type
+
+(type_keyword) @type.builtin
+
+(type
+ [
+ (local_var)
+ (global_var)
+ ] @type)
+
+(global_type
+ (local_var) @type.definition)
+
+(argument) @variable.parameter
+
+(_
+ inst_name: _ @keyword.operator)
+
+[
+ "catch"
+ "filter"
+] @keyword.operator
+
+[
+ "to"
+ "nuw"
+ "nsw"
+ "exact"
+ "unwind"
+ "from"
+ "cleanup"
+ "swifterror"
+ "volatile"
+ "inbounds"
+ "inrange"
+] @keyword
+
+(icmp_cond) @keyword
+
+(fcmp_cond) @keyword
+
+(fast_math) @keyword
+
+(_
+ callee: _ @function)
+
+(function_header
+ name: _ @function)
+
+[
+ "declare"
+ "define"
+] @keyword.function
+
+(calling_conv) @keyword.function
+
+[
+ "target"
+ "triple"
+ "datalayout"
+ "source_filename"
+ "addrspace"
+ "blockaddress"
+ "align"
+ "syncscope"
+ "within"
+ "uselistorder"
+ "uselistorder_bb"
+ "module"
+ "asm"
+ "sideeffect"
+ "alignstack"
+ "inteldialect"
+ "unwind"
+ "type"
+ "global"
+ "constant"
+ "externally_initialized"
+ "alias"
+ "ifunc"
+ "section"
+ "comdat"
+ "any"
+ "exactmatch"
+ "largest"
+ "nodeduplicate"
+ "samesize"
+ "distinct"
+ "attributes"
+ "vscale"
+] @keyword
+
+[
+ "no_cfi"
+ (dso_local)
+ (linkage_aux)
+ (visibility)
+] @keyword.modifier
+
+[
+ "thread_local"
+ "localdynamic"
+ "initialexec"
+ "localexec"
+ (unnamed_addr)
+ (dll_storage_class)
+] @keyword.modifier
+
+(attribute_name) @attribute
+
+(function_header
+ [
+ (linkage)
+ (calling_conv)
+ (unnamed_addr)
+ ] @keyword.function)
+
+(number) @number
+
+(comment) @comment @spell
+
+(string) @string
+
+(cstring) @string
+
+(label) @label
+
+(_
+ inst_name: "ret" @keyword.return)
+
+(float) @number.float
+
+[
+ (struct_value)
+ (array_value)
+ (vector_value)
+] @constructor
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+ "<"
+ ">"
+ "<{"
+ "}>"
+] @punctuation.bracket
+
+[
+ ","
+ ":"
+] @punctuation.delimiter
+
+[
+ "="
+ "|"
+ "x"
+ "..."
+] @operator
+
+[
+ "true"
+ "false"
+] @boolean
+
+[
+ "undef"
+ "poison"
+ "null"
+ "none"
+ "zeroinitializer"
+] @constant.builtin
diff --git a/runtime/queries/llvm/injections.scm b/runtime/queries/llvm/injections.scm
new file mode 100644
index 000000000..2f0e58eb6
--- /dev/null
+++ b/runtime/queries/llvm/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))