Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Assembly support #246

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/dist

*.tar.gz
*.elc
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -382,3 +382,9 @@
branch = master
update = none
ignore = dirty
[submodule "repos/asm"]
path = repos/asm
url = https://github.com/rush-rs/tree-sitter-asm
branch = main
update = none
ignore = dirty
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased
- Add `Assembly` support

## 0.12.49 - 2023-09-10
- Improve `CMake` highlight.scm
Expand Down
32 changes: 32 additions & 0 deletions queries/asm/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
; General
(label (ident) @label)
(reg) @variable.builtin
(meta
kind: (_) @function.builtin)
(instruction
kind: (_) @function.call)

; Comments
(line_comment) @comment

; Literals
(int) @number
(float) @number
(string) @string

; Keywords
[
"byte"
"word"
"dword"
"qword"
"ptr"
"rel"
] @keyword

; Operators & Punctuation
["+" "-" "*"] @operator

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

["," ":"] @punctuation.delimiter
1 change: 1 addition & 0 deletions repos/asm
Submodule asm added at 36dc26
3 changes: 3 additions & 0 deletions tree-sitter-langs.el
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ See `tree-sitter-langs-repos'."
'((ada-mode . ada)
(agda-mode . agda)
(agda2-mode . agda)
(fasm-mode . asm)
(masm-mode . asm)
(nasm-mode . asm)
(sh-mode . bash)
(beancount-mode . beancount)
(bibtex-mode . bibtex)
Expand Down