#dockerfile #parser #incremental

tree-sitter-dockerfile

dockerfile grammar for the tree-sitter parsing library

3 releases (breaking)

new 0.2.0 May 9, 2024
0.1.0 Sep 9, 2021
0.0.1 Sep 9, 2021

#95 in Text editors

Download history 196/week @ 2024-01-22 19/week @ 2024-01-29 39/week @ 2024-02-05 14/week @ 2024-02-12 29/week @ 2024-02-19 42/week @ 2024-02-26 28/week @ 2024-03-04 38/week @ 2024-03-11 55/week @ 2024-03-18 43/week @ 2024-03-25 86/week @ 2024-04-01 58/week @ 2024-04-08 42/week @ 2024-04-15 55/week @ 2024-04-22 32/week @ 2024-04-29 166/week @ 2024-05-06

310 downloads per month
Used in 4 crates (3 directly)

MIT license

290KB
9K SLoC

C 9K SLoC // 0.0% comments JavaScript 412 SLoC // 0.1% comments Scheme 49 SLoC Rust 36 SLoC // 0.4% comments

tree-sitter-dockerfile

Dockerfile grammar for tree-sitter.

An action shot of highlighting in neovim: Screen Shot 2021-06-29 at 08 35 19


lib.rs:

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

Dependencies

~2.7–4MB
~71K SLoC