#tree-sitter #dockerfile #incremental #parser

tree-sitter-dockerfile

dockerfile grammar for the tree-sitter parsing library

3 releases (breaking)

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

#173 in Text editors

Download history 53/week @ 2024-08-18 69/week @ 2024-08-25 56/week @ 2024-09-01 33/week @ 2024-09-08 48/week @ 2024-09-15 86/week @ 2024-09-22 68/week @ 2024-09-29 9/week @ 2024-10-06 15/week @ 2024-10-13 16/week @ 2024-10-20 44/week @ 2024-10-27 25/week @ 2024-11-03 7/week @ 2024-11-10 53/week @ 2024-11-17 54/week @ 2024-11-24 35/week @ 2024-12-01

150 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
~76K SLoC