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

#253 in Build Utils

Download history 679/week @ 2024-10-26 623/week @ 2024-11-02 1824/week @ 2024-11-09 1502/week @ 2024-11-16 579/week @ 2024-11-23 496/week @ 2024-11-30 608/week @ 2024-12-07 635/week @ 2024-12-14 644/week @ 2024-12-21 492/week @ 2024-12-28 516/week @ 2025-01-04 403/week @ 2025-01-11 359/week @ 2025-01-18 264/week @ 2025-01-25 850/week @ 2025-02-01 3397/week @ 2025-02-08

4,916 downloads per month
Used in 7 crates (4 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