1 unstable release
0.3.0 | Jun 27, 2024 |
---|
#2852 in Parser implementations
43KB
1.5K
SLoC
tree-sitter-xcompose
A tree-sitter parser for XCompose files.
References
Editors
- Neovim
- Helix
- Emacs
- Zed
lib.rs
:
This crate provides XCompose language support for the tree-sitter parsing library.
Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:
let code = r#"
include "%L"
<Multi_key> <g> <a> : "α"
<Multi_key> <g> <b> : "β"
<Multi_key> <g> <g> : "γ"
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_xcompose::language();
parser.set_language(&language).expect("Error loading xcompose grammar");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());
Dependencies
~2.8–4MB
~78K SLoC