tree-sitter-x86asm

October 8, 2023 ยท View on GitHub

A tree-sitter grammar for x86 assembly, Intel syntax.

Just enough to highlight stuff on https://fasterthanli.me/.

In particular:

  • Parsing of effective addresses is very hacky (but highlights fine)
    • NASM macros aren't parsed at all
    • A ton of stuff is missing

But still, it makes a bunch of code look good, and that's good enough for me.

It even sorta-understands objdump output:

License

This project is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.