8 releases

0.1.7 Dec 21, 2024
0.1.6 Nov 17, 2024
0.1.5 Oct 10, 2024
0.1.4 Sep 2, 2024
0.1.2 Nov 27, 2023

#269 in Build Utils

Download history 1626/week @ 2024-09-25 758/week @ 2024-10-02 787/week @ 2024-10-09 997/week @ 2024-10-16 672/week @ 2024-10-23 591/week @ 2024-10-30 805/week @ 2024-11-06 2436/week @ 2024-11-13 649/week @ 2024-11-20 547/week @ 2024-11-27 567/week @ 2024-12-04 568/week @ 2024-12-11 733/week @ 2024-12-18 434/week @ 2024-12-25 602/week @ 2025-01-01 402/week @ 2025-01-08

2,203 downloads per month
Used in 6 crates (3 directly)

Apache-2.0

40KB
1K SLoC

Lossless parser for Makefiles

This crate provides a lossless parser for makefiles, creating a modifiable CST.

Example:


let mf = Makefile::read("Makefile").unwrap();

println!("Rules in the makefile: {:?}", mf.rules().map(|r| r.targets().join(" ")).collect::<Vec<_>>());

lib.rs:

A lossless parser for Makefiles

Example:

use std::io::Read;
let contents = r#"PYTHON = python3

.PHONY: all

all: build

build:
	$(PYTHON) setup.py build
"#;
let makefile: makefile_lossless::Makefile = contents.parse().unwrap();

assert_eq!(makefile.rules().count(), 3);

Dependencies

~1MB
~16K SLoC