65 stable releases
new 2024.12.12 | Dec 12, 2024 |
---|---|
2024.11.21 | Nov 21, 2024 |
2024.7.25 | Jul 25, 2024 |
2024.3.28 | Mar 28, 2024 |
1.0.3 | Mar 30, 2022 |
#81 in Text editors
578 downloads per month
6MB
120K
SLoC
tree-sitter-ssh-client-config
SSH client config grammar for tree-sitter.
Usage
This grammar is available at crates.io, and you can use it together with the Rust language binding.
use tree_sitter::{Parser, Language};
let mut parser = Parser::new();
parser.set_language(tree_sitter_ssh_client_config::language()).expect("Error loading SSH client config grammar");
let config = "\
Host example.com
User your-name
Port 12345";
let tree = parser.parse(config, None).unwrap();
assert_eq!(tree.root_node().to_sexp(), "(client_config (host (host_value)) (user (user_value)) (port (port_value)))");
References
lib.rs
:
This crate provides ssh-client-config 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 = "";
let mut parser = tree_sitter::Parser::new();
parser.set_language(tree_sitter_ssh_client_config::language()).expect("Error loading ssh-client-config grammar");
let tree = parser.parse(code, None).unwrap();
Dependencies
~2.8–4MB
~79K SLoC