Skip to content

Commit

Permalink
add llvm
Browse files Browse the repository at this point in the history
  • Loading branch information
kirawi committed Nov 25, 2021
1 parent 67bf425 commit 0e67531
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,7 @@
path = helix-syntax/languages/tree-sitter-perl
url = https://github.com/ganezdragon/tree-sitter-perl
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
5 changes: 3 additions & 2 deletions book/src/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ We use a similar set of scopes as
- `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`
Expand Down
8 changes: 8 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,11 @@ file-types = ["rkt"]
shebangs = ["racket"]
comment-token = ";"
language-server = { command = "racket", args = ["-l", "racket-langserver"] }

[[language]]
name = "llvm"
scope = "source.llvm"
roots = []
file-types = ["ll"]
comment-token = ";"
indent = { tab-width = 2, unit = " " }
14 changes: 14 additions & 0 deletions runtime/queries/llvm/highlights.scm
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0e67531

Please sign in to comment.