1
0
Fork 0
mirror of https://github.com/helix-editor/helix synced 2024-06-02 08:06:07 +02:00

Add llvm grammar (#1167)

This commit is contained in:
Kirawi 2021-11-28 20:38:17 -05:00 committed by GitHub
parent dc53e65b9e
commit 6f1a7b1220
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 2 deletions

4
.gitmodules vendored
View File

@ -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

View File

@ -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`

View File

@ -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 = " " }

View 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