#tree-sitter #incremental #less

tree-sitter-less

LESS grammar for tree-sitter

1 stable release

1.0.0 Jul 11, 2024

#187 in Text editors

MIT license

720KB
26K SLoC

C 26K SLoC JavaScript 187 SLoC // 0.2% comments Rust 37 SLoC // 0.1% comments Scheme 23 SLoC

tree-sitter-less

CI crates npm pypi

LESS grammar for tree-sitter.


lib.rs:

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

Dependencies

~3–4MB
~77K SLoC