Skip to content

Add GNU assembly syntax highlighting - #1015

Open
Alan Smith (alan-d-smith) wants to merge 4 commits into
microsoft:mainfrom
alan-d-smith:add-gas-highlighting
Open

Alan Smith (alan-d-smith) wants to merge 4 commits into
microsoft:mainfrom
alan-d-smith:add-gas-highlighting

Conversation

@alan-d-smith

@alan-d-smith Alan Smith (alan-d-smith) commented Nov 26, 2026 •

Copy link
Copy Markdown

This adds initial LSH syntax highlighting support for GNU assembly (.s files), including Intel syntax.
It also handles NASM and MASM code in .s files, such as %define and PROC/ENDP.
The test sample covers AVR, x86-64, ARM, AArch64 and RISC-V.

Scope

This is a lightweight LSH-only change with no new dependencies.

The changes are limited to syntax definitions and highlighting fixtures:

  • New LSH definition for GNU assembly.
  • New GNU assembly highlighting test sample.
gas-highlighting-v2

Validation

  • cargo test -q

@alan-d-smith

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@lhecker

Copy link
Copy Markdown
Member

Oh, this is nice. I'm okay with this if you also make Intel assembly syntax work 1. 🙂😄

Footnotes

  1. The superior assembly syntax! ...according to me. 😄 ↩

@alan-d-smith

Copy link
Copy Markdown
Author

Yeah that makes sense, Intel syntax should work now:

gas-intel

I was wondering if you think it would make sense for *.asm files to share this definition too? NASM/MASM files show mostly correctly, but things like STRUCT or SEGMENT blocks, NASM's binary literals in the form 1010b, and NASM's // operator don't display as they should. Some things clash with GNU syntax, so I think a separate definition might be prettier, but let me know what you think is best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants