#parser #incremental #earthfile

tree-sitter-earthfile

earthfile grammar for the tree-sitter parsing library

13 unstable releases (3 breaking)

new 0.4.3 May 20, 2024
0.4.2 May 20, 2024
0.3.0 Apr 25, 2024
0.2.4 Apr 16, 2024
0.1.2 Mar 25, 2024

#116 in Text editors

Download history 110/week @ 2024-03-17 234/week @ 2024-03-24 233/week @ 2024-03-31 226/week @ 2024-04-07 540/week @ 2024-04-14 805/week @ 2024-04-21 1183/week @ 2024-04-28 755/week @ 2024-05-05 434/week @ 2024-05-12

3,199 downloads per month
Used in earthlyls

MIT license

2.5MB
99K SLoC

C 98K SLoC // 0.0% comments JavaScript 725 SLoC Scheme 69 SLoC Rust 34 SLoC // 0.1% comments

tree-sitter-earthfile

tree-sitter grammar for Earthfile.

Screenshot of yage Earthfile in neovim

License

tree-sitter-earthfile is distributed under the terms of the MIT license.

See LICENSE for details.


lib.rs:

This crate provides Earthfile 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_earthfile::language()).expect("Error loading Earthfile grammar");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

Dependencies

~2.7–4MB
~71K SLoC