on master help sign in
Add llvm grammar (#1167)
6f1a7b1Kirawi
.gitmodules+4
@@ -146,3 +146,7 @@
146 path = helix-syntax/languages/tree-sitter-wgsl
146 path = helix-syntax/languages/tree-sitter-wgsl
147 url = https://github.com/szebniok/tree-sitter-wgsl
147 url = https://github.com/szebniok/tree-sitter-wgsl
148 shallow = true
148 shallow = true
149+[submodule "helix-syntax/tree-sitter-llvm"]
150+ path = helix-syntax/languages/tree-sitter-llvm
151+ url = https://github.com/benwilliamgraham/tree-sitter-llvm
152+ shallow = true
book/src/themes.md+3−2
@@ -145,11 +145,12 @@ We use a similar set of scopes as
145 - `conditional` - `if`, `else`
145 - `conditional` - `if`, `else`
146 - `repeat` - `for`, `while`, `loop`
146 - `repeat` - `for`, `while`, `loop`
147 - `import` - `import`, `export`
147 - `import` - `import`, `export`
148− - (TODO: return?)
148+ - `return`
149+ - `operator` - `or`, `in`
149 - `directive` - Preprocessor directives (`#if` in C)
150 - `directive` - Preprocessor directives (`#if` in C)
150 - `function` - `fn`, `func`
151 - `function` - `fn`, `func`
151
152
152−- `operator` - `||`, `+=`, `>`, `or`
153+- `operator` - `||`, `+=`, `>`
153
154
154- `function`
155- `function`
155 - `builtin`
156 - `builtin`
languages.toml+8
@@ -413,3 +413,11 @@ file-types = ["wgsl"]
413roots = []
413roots = []
414comment-token = "//"
414comment-token = "//"
415indent = { tab-width = 4, unit = " " }
415indent = { tab-width = 4, unit = " " }
416+
417+[[language]]
418+name = "llvm"
419+scope = "source.llvm"
420+roots = []
421+file-types = ["ll"]
422+comment-token = ";"
423+indent = { tab-width = 2, unit = " " }
runtime/queries/llvm/highlights.scmnew file+14
@@ -0,0 +1,14 @@
1+(type) @type
2+(statement) @keyword.operator
3+(number) @constant.numeric.integer
4+(comment) @comment
5+(string) @string
6+(label) @label
7+(keyword) @keyword
8+"ret" @keyword.control.return
9+(boolean) @constant.builtin.boolean
10+(float) @constant.numeric.float
11+(constant) @constant
12+(identifier) @variable
13+(symbol) @punctuation.delimiter
14+(bracket) @punctuation.bracket