tree-sitter-restedlang

Restedlang grammar for tree-sitter

1 unstable release

0.0.1 Jun 17, 2024

MIT license

105KB
3.5K SLoC

C 3.5K SLoC JavaScript 86 SLoC Scheme 40 SLoC Rust 29 SLoC // 0.3% comments

tree-sitter-restedlang

restedlang is being developed at part of the rested project.

Usage (Neovim)

nvim-treesitter has the full relevant instructions.

Clone this repo into ~/projects/tree-sitter-restedlang/

mkdir ~/projects/tree-sitter-restedlang
git clone https://github.com/Gnarus-G/tree-sitter-restedlang ~/projects/tree-sitter-restedlang

Then use the neovim plugin


lib.rs:

This crate provides Restedlang 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#"
"#;
let mut parser = tree_sitter::Parser::new();
parser.set_language(&tree_sitter_restedlang::language()).expect("Error loading Restedlang grammar");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

Dependencies

~3–4MB
~77K SLoC