mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Add llvm grammar (#1167)
This commit is contained in:
parent
dc53e65b9e
commit
6f1a7b1220
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -146,3 +146,7 @@
|
||||
path = helix-syntax/languages/tree-sitter-wgsl
|
||||
url = https://github.com/szebniok/tree-sitter-wgsl
|
||||
shallow = true
|
||||
[submodule "helix-syntax/tree-sitter-llvm"]
|
||||
path = helix-syntax/languages/tree-sitter-llvm
|
||||
url = https://github.com/benwilliamgraham/tree-sitter-llvm
|
||||
shallow = true
|
||||
|
@ -145,11 +145,12 @@ #### Syntax highlighting
|
||||
- `conditional` - `if`, `else`
|
||||
- `repeat` - `for`, `while`, `loop`
|
||||
- `import` - `import`, `export`
|
||||
- (TODO: return?)
|
||||
- `return`
|
||||
- `operator` - `or`, `in`
|
||||
- `directive` - Preprocessor directives (`#if` in C)
|
||||
- `function` - `fn`, `func`
|
||||
|
||||
- `operator` - `||`, `+=`, `>`, `or`
|
||||
- `operator` - `||`, `+=`, `>`
|
||||
|
||||
- `function`
|
||||
- `builtin`
|
||||
|
@ -413,3 +413,11 @@ file-types = ["wgsl"]
|
||||
roots = []
|
||||
comment-token = "//"
|
||||
indent = { tab-width = 4, unit = " " }
|
||||
|
||||
[[language]]
|
||||
name = "llvm"
|
||||
scope = "source.llvm"
|
||||
roots = []
|
||||
file-types = ["ll"]
|
||||
comment-token = ";"
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
14
runtime/queries/llvm/highlights.scm
Normal file
14
runtime/queries/llvm/highlights.scm
Normal file
@ -0,0 +1,14 @@
|
||||
(type) @type
|
||||
(statement) @keyword.operator
|
||||
(number) @constant.numeric.integer
|
||||
(comment) @comment
|
||||
(string) @string
|
||||
(label) @label
|
||||
(keyword) @keyword
|
||||
"ret" @keyword.control.return
|
||||
(boolean) @constant.builtin.boolean
|
||||
(float) @constant.numeric.float
|
||||
(constant) @constant
|
||||
(identifier) @variable
|
||||
(symbol) @punctuation.delimiter
|
||||
(bracket) @punctuation.bracket
|
Loading…
Reference in New Issue
Block a user