Skip to content

Commit

Permalink
add GNU assembler (gas) support helix-editor#8291)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirius94 authored and Schuyler Mortimer committed Jul 10, 2024
1 parent 17a60a1 commit 5217f52
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
| forth || | | `forth-lsp` |
| fortran || || `fortls` |
| fsharp || | | `fsautocomplete` |
| gas ||| | |
| gdscript |||| |
| gemini || | | |
| git-attributes || | | |
Expand Down
15 changes: 14 additions & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@ source = { git = "https://github.com/erasin/tree-sitter-po", rev = "417cee9abb20
[[language]]
name = "nasm"
scope = "source.nasm"
file-types = ["asm", "s", "S", "nasm"]
file-types = ["asm", "S", "nasm"]
injection-regex = "n?asm"
roots = []
comment-token = ";"
Expand All @@ -2505,6 +2505,19 @@ indent = { tab-width = 8, unit = " " }
name = "nasm"
source = { git = "https://github.com/naclsn/tree-sitter-nasm", rev = "a0db15db6fcfb1bf2cc8702500e55e558825c48b" }

[[language]]
name = "gas"
scope = "source.gas"
file-types = ["s"]
injection-regex = "gas"
roots = []
comment-token = "#"
indent = { tab-width = 8, unit = " " }

[[grammar]]
name = "gas"
source = { git = "https://github.com/sirius94/tree-sitter-gas", rev = "60f443646b20edee3b7bf18f3a4fb91dc214259a" }

[[language]]
name = "rst"
scope = "source.rst"
Expand Down
21 changes: 21 additions & 0 deletions runtime/queries/gas/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(comment) @comment
(number) @constant.numeric
(directive_name) @keyword.directive
(symbol) @variable
(label) @function
(label)
(instruction_prefix) @keyword
(instruction_name) @function.special
(register) @constant.builtin
(string) @string
(char) @constant.character
(type) @type
(constant "$" @constant)
(operand_modifier) @attribute

(expression
["-" "+" "*" "/" "="] @operator)

["(" ")"] @punctuation.bracket

["," ":"] @punctuation.delimiter
2 changes: 2 additions & 0 deletions runtime/queries/gas/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/gas/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(comment) @comment.inside
(comment)+ @comment.around

0 comments on commit 5217f52

Please sign in to comment.