summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Schenkel2023-09-16 00:04:44 +0000
committerGitHub2023-09-16 00:04:44 +0000
commit941dc6c614d684804c3580c4ae8b3c4368aab217 (patch)
tree9c5f661a64dd74b811e0e33399aa841b0c9b41aa
parent19d44b6fde2a7689ff32410c573106b9c8359236 (diff)
add GNU assembler (gas) support #8291)
-rw-r--r--book/src/generated/lang-support.md1
-rw-r--r--languages.toml15
-rw-r--r--runtime/queries/gas/highlights.scm21
-rw-r--r--runtime/queries/gas/injections.scm2
-rw-r--r--runtime/queries/gas/textobjects.scm2
5 files changed, 40 insertions, 1 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index c1b0acfd..9d036b73 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -44,6 +44,7 @@
| forth | ✓ | | | `forth-lsp` |
| fortran | ✓ | | ✓ | `fortls` |
| fsharp | ✓ | | | `fsautocomplete` |
+| gas | ✓ | ✓ | | |
| gdscript | ✓ | ✓ | ✓ | |
| gemini | ✓ | | | |
| git-attributes | ✓ | | | |
diff --git a/languages.toml b/languages.toml
index 37d2e94c..a6ff9c67 100644
--- a/languages.toml
+++ b/languages.toml
@@ -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 = ";"
@@ -2506,6 +2506,19 @@ 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"
comment-token = ".."
diff --git a/runtime/queries/gas/highlights.scm b/runtime/queries/gas/highlights.scm
new file mode 100644
index 00000000..46cefcba
--- /dev/null
+++ b/runtime/queries/gas/highlights.scm
@@ -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
diff --git a/runtime/queries/gas/injections.scm b/runtime/queries/gas/injections.scm
new file mode 100644
index 00000000..2f0e58eb
--- /dev/null
+++ b/runtime/queries/gas/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/gas/textobjects.scm b/runtime/queries/gas/textobjects.scm
new file mode 100644
index 00000000..4465c876
--- /dev/null
+++ b/runtime/queries/gas/textobjects.scm
@@ -0,0 +1,2 @@
+(comment) @comment.inside
+(comment)+ @comment.around