1 stable release

new 1.1.1 Dec 21, 2024

#378 in Text editors

Download history 155/week @ 2024-12-16

155 downloads per month

MIT license

1MB
38K SLoC

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

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


lib.rs:

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());

Dependencies

~4–310KB