#dot #graphviz #parser #incremental

tree-sitter-dot

DOT grammar for the tree-sitter parsing library

4 releases

0.1.6 Oct 13, 2021
0.1.5 Sep 21, 2021
0.1.4 Aug 30, 2021
0.1.3 Apr 6, 2021

#374 in Text editors

MIT license

155KB
5K SLoC

C 4.5K SLoC JavaScript 158 SLoC Scheme 39 SLoC Rust 33 SLoC

tree-sitter-dot

Test

DOT grammar for tree-sitter.


lib.rs:

This crate provides dot 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#"
    graph {
        a -- b
    }
"#;
let mut parser = tree_sitter::Parser::new();
parser.set_language(tree_sitter_dot::language()).expect("Error loading dot grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies

~2.7–4MB
~72K SLoC