-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 nasm language #6068
feat: add nasm language #6068
Conversation
Co-authored-by: Grenier Celestin <[email protected]>
Neat, thanks for using my work! Like most language with (C-like) preprocessor, the written code can be syntactically invalid despite being correct. This is why I had the same approach as the C highlight queries to not have |
Ah, that makes sense, thanks for taking a look at the changes! I've removed that query in eda2cc6. |
runtime/queries/nasm/highlights.scm
Outdated
(#match? @constant.builtin "^__\\?[A-Z_a-z0-9]+\\?__$")) | ||
(word) @variable | ||
|
||
(preproc_arg) @keyword |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the preprocessor stuff is like the C preprocessor, these might fall under @keyword.directive
https://docs.helix-editor.com/master/themes.html#syntax-highlighting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right that @keyword.directive
makes more sense. I've switched it to that in df21375 along with a few other improvements.
Co-authored-by: Michael Davis <[email protected]>
This pull request adds nasm assembly as a language.
Closes #3329.
Under the issue mentioned above, there is a discussion about how to support various assembly flavours. I think the best approach is to add flavour-specific language definitions with the appropriate grammars, then users can override the
file-types
values as desired in their locallanguages.toml
files so that the.asm
extension (or whichever extension they're using) is recognized as the flavour that they're working with. Since nasm will be the only flavour supported so far after the changes in this merge request, I've included the.asm
extension under nasm'sfile-types
so that there is at least some syntax highlighting out of the box, even though it might not be for the right flavour. If there's a different approach that might work better though, just let me know and I can rework things.Also, CC @naclsn (the original author of the grammar and queries). I hope you don't mind me including your work here; I've copied the queries pretty much verbatim, only I've removed some todo-related comments that probably don't belong in the version inside this repository, and I've uncommented the
(ERROR) @error
highlight.Edit: oh, and here's a screenshot: