Crates.io | tree-sitter-ssh-client-config |
lib.rs | tree-sitter-ssh-client-config |
version | 2024.11.7 |
source | src |
created_at | 2022-03-27 12:27:51.742581 |
updated_at | 2024-11-07 03:12:36.559209 |
description | SSH client config grammar for the tree-sitter parsing library |
homepage | |
repository | https://github.com/metio/tree-sitter-ssh-client-config |
max_upload_size | |
id | 557248 |
size | 6,243,080 |
SSH client config grammar for tree-sitter.
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)))");