#incremental #parsing #ssh #client #config

tree-sitter-ssh-client-config

SSH client config grammar for the tree-sitter parsing library

4 stable releases

new 2023.2.2 Feb 2, 2023
1.0.4 Jan 23, 2023
1.0.3 Mar 30, 2022
1.0.1 Mar 27, 2022

#46 in Text editors

Download history 1/week @ 2022-10-16 2/week @ 2022-10-30 1/week @ 2022-11-13 2/week @ 2022-11-20 1/week @ 2022-11-27 2/week @ 2022-12-04 2/week @ 2022-12-11 2/week @ 2022-12-25 2/week @ 2023-01-01 4/week @ 2023-01-08 3/week @ 2023-01-15 27/week @ 2023-01-22 31/week @ 2023-01-29

65 downloads per month

CC0 license

5.5MB
110K SLoC

C 109K SLoC JavaScript 796 SLoC Scheme 219 SLoC Rust 31 SLoC // 0.5% comments

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 sshclientconfig 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_sshclientconfig::language()).expect("Error loading sshclientconfig grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies

~1.4–2MB
~52K SLoC