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

Add highlighting for assembler (.s) #3329

Closed
kchibisov opened this issue Aug 4, 2022 · 8 comments · Fixed by #6068
Closed

Add highlighting for assembler (.s) #3329

kchibisov opened this issue Aug 4, 2022 · 8 comments · Fixed by #6068
Labels
A-tree-sitter Area: Tree-sitter C-enhancement Category: Improvements

Comments

@kchibisov
Copy link

Would need a tree-sitter grammar for that.

@kchibisov kchibisov added the C-enhancement Category: Improvements label Aug 4, 2022
@the-mikedavis the-mikedavis added the A-tree-sitter Area: Tree-sitter label Aug 4, 2022
@naclsn
Copy link
Contributor

naclsn commented Aug 4, 2022

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...

@kchibisov
Copy link
Author

I mainly see gas, since that's what everything dumps by default... Would be nice to have some primitive highlighting for both of them.

@A-Walrus
Copy link
Contributor

A-Walrus commented Aug 5, 2022

It would also be nice to use the asm tree sitter for inline assembly in languages such as Rust, C/C++ ...

@kchibisov
Copy link
Author

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++.

@A-Walrus
Copy link
Contributor

A-Walrus commented Aug 5, 2022

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.

@jtepe
Copy link
Contributor

jtepe commented Oct 23, 2022

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.

@kdwarn
Copy link

kdwarn commented Mar 21, 2023

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?

@the-mikedavis
Copy link
Member

Yep only nasm is currently supported. I think a new issue for gas is perferrable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tree-sitter Area: Tree-sitter C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants