3 releases (breaking)
0.24.0 | Feb 6, 2025 |
---|---|
0.22.6 | Aug 9, 2024 |
0.1.0 | Mar 28, 2023 |
#112 in Text editors
1,928 downloads per month
Used in 2 crates
135KB
5K
SLoC
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.
lib.rs
:
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());
Dependencies
~4–310KB