1 stable release

1.1.1 Dec 21, 2024

#12 in #make

Download history 99/week @ 2025-01-07 22/week @ 2025-01-14 101/week @ 2025-01-21 49/week @ 2025-01-28 200/week @ 2025-02-04 920/week @ 2025-02-11 498/week @ 2025-02-18 253/week @ 2025-02-25 308/week @ 2025-03-04 190/week @ 2025-03-11 378/week @ 2025-03-18 234/week @ 2025-03-25 304/week @ 2025-04-01 232/week @ 2025-04-08 242/week @ 2025-04-15 228/week @ 2025-04-22

1,043 downloads per month
Used in 2 crates

MIT license

1MB
38K SLoC

C 38K SLoC JavaScript 508 SLoC // 0.1% comments Scheme 137 SLoC // 0.0% comments Rust 27 SLoC

This crate provides Make language support for the tree-sitter parsing library.

Typically, you will use the [LANGUAGE][] constant 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();
let language = tree_sitter_make::LANGUAGE;
parser
    .set_language(&language.into())
    .expect("Error loading Make parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

tree-sitter-make

Tree-sitter-make is a Make parser intended to be used for syntax highlighting.

Missing features

  • Support to custom .RECIPEPREFIX
  • Load directive

This parser uses GNUMakefile documentation as reference. Others makefile formats might have features not implemented by this grammar. Feel free to open an issue with a feature request or do a pull request to extend this grammar to support other makefiles formats.

Reference

Dependencies

~4–280KB