1 unstable release

0.10.0 Mar 16, 2024

#187 in Text editors

39 downloads per month

MIT license

1MB
36K SLoC

C 35K SLoC JavaScript 546 SLoC // 0.0% comments Scheme 66 SLoC Rust 31 SLoC // 0.5% comments

tree-sitter-devicetree

A tree-sitter grammar for Devicetree with support for Zephyr's superset of Devicetree syntax.

Some parts of the grammar are adapted from tree-sitter-c.


lib.rs:

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

Dependencies

~2.7–4MB
~71K SLoC