#tree-sitter #assembly #incremental-parser #parser

tree-sitter-asm

assembly grammar for the tree-sitter parsing library

3 releases (breaking)

0.24.0 Feb 6, 2025
0.22.6 Aug 9, 2024
0.1.0 Mar 28, 2023

#145 in Text editors

Download history 303/week @ 2024-12-22 292/week @ 2024-12-29 361/week @ 2025-01-05 408/week @ 2025-01-12 378/week @ 2025-01-19 427/week @ 2025-01-26 642/week @ 2025-02-02 408/week @ 2025-02-09 406/week @ 2025-02-16 463/week @ 2025-02-23 429/week @ 2025-03-02 445/week @ 2025-03-09 402/week @ 2025-03-16 421/week @ 2025-03-23 496/week @ 2025-03-30 372/week @ 2025-04-06

1,748 downloads per month
Used in 7 crates (3 directly)

MIT and maybe GPL-3.0-only

135KB
5K SLoC

C 4.5K SLoC JavaScript 137 SLoC // 0.0% comments Scheme 51 SLoC // 0.1% comments Rust 30 SLoC // 0.1% comments

This crate provides asm language support for the tree-sitter parsing library.

Typically, you will use the [LANGUAGE][] constant to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = "pushq %rbp, %rbp";
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_asm::LANGUAGE;
parser
    .set_language(&language.into())
    .expect("Error loading asm parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

tree-sitter-asm

Generic assembly grammar for tree-sitter

Usage in Neovim

Parser Installation

The parser is included in the nvim-treesitter plugin. To use it, simply install it with :TSInstall asm or by adding it to your ensure_installed list.

Dependencies

~4–280KB