helix
helix copied to clipboard
Add highlighting for assembler (.s)
Would need a tree-sitter grammar for that.
If I may; a problem with assembly 'language' suport is which? I have a tree-sitter-nasm which I used a fair amount for nasm assembly, but it probably won't handle eg. gas syntax well...
I mainly see gas, since that's what everything dumps by default... Would be nice to have some primitive highlighting for both of them.
It would also be nice to use the asm tree sitter for inline assembly in languages such as Rust, C/C++ ...
I'm pretty sure that you can't do that with rust, given that its syntax is a bit different from what I remember or has a different more usable for form compared to C/C++.
Yeah you're right, it has a different syntax:
unsafe {
asm!(
"mov {tmp}, {x}",
"shl {tmp}, 1",
"shl {x}, 2",
"add {x}, {tmp}",
x = inout(reg) x,
tmp = out(reg) _,
);
}
I suppose a tree-sitter parser for rust-inline-assembly could be written and used, but that's a separate feature.
If I may; a problem with assembly 'language' suport is which? I have a tree-sitter-nasm which I used a fair amount for nasm assembly, but it probably won't handle eg. gas syntax well...
I would be highly interested in having nasm support. IIRC, it's also highly used out there. Separate gas support would also be nice.
Gas syntax is not yet included, correct? If that's the case, should this issue be reopened until it is or should another issue be created?
Yep only nasm is currently supported. I think a new issue for gas is perferrable