#tree-sitter #parser #incremental #earthfile

tree-sitter-earthfile

earthfile grammar for the tree-sitter parsing library

19 unstable releases (5 breaking)

0.6.0 Feb 18, 2025
0.5.4 Jun 4, 2024
0.5.2 May 30, 2024
0.4.3 May 20, 2024
0.1.2 Mar 25, 2024

#250 in Text editors

Download history 187/week @ 2024-11-13 135/week @ 2024-11-20 263/week @ 2024-11-27 193/week @ 2024-12-04 179/week @ 2024-12-11 134/week @ 2024-12-18 101/week @ 2024-12-25 116/week @ 2025-01-01 252/week @ 2025-01-08 194/week @ 2025-01-15 119/week @ 2025-01-22 145/week @ 2025-01-29 127/week @ 2025-02-05 270/week @ 2025-02-12 314/week @ 2025-02-19 156/week @ 2025-02-26

885 downloads per month
Used in earthlyls

MIT license

3.5MB
125K SLoC

C 124K SLoC // 0.0% comments JavaScript 735 SLoC // 0.0% comments Scheme 68 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.8–4MB
~77K SLoC