#sus #incremental #parser

tree-sitter-sus

sus grammar for the tree-sitter parsing library

2 releases

0.0.2 Jul 27, 2024
0.0.1 Jul 27, 2024

#272 in Text editors


Used in 2 crates

GPL-3.0-or-later

295KB
10K SLoC

C 10K SLoC JavaScript 266 SLoC // 0.1% comments Rust 31 SLoC // 0.5% comments

Tree-Sitter grammar for the SUS Language

Generated using tree-sitter. Used as the parsing front-end of the sus-compiler.

The SUS compiler repository is here.

This package provides bindings for C, C++, and Rust. (And tree-sitter implemented a few more but who's counting. )

The language definition is in grammar.js. For examples, see the SUS compiler repository.


lib.rs:

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

Dependencies

~2.8–4MB
~73K SLoC