6 releases

new 0.1.5 Oct 10, 2024
0.1.4 Sep 2, 2024
0.1.3 Jun 27, 2024
0.1.2 Nov 27, 2023

#226 in Build Utils

Download history 661/week @ 2024-06-20 1184/week @ 2024-06-27 786/week @ 2024-07-04 826/week @ 2024-07-11 547/week @ 2024-07-18 1637/week @ 2024-07-25 1380/week @ 2024-08-01 2164/week @ 2024-08-08 1150/week @ 2024-08-15 1249/week @ 2024-08-22 1789/week @ 2024-08-29 1778/week @ 2024-09-05 1127/week @ 2024-09-12 1486/week @ 2024-09-19 1650/week @ 2024-09-26 780/week @ 2024-10-03

5,138 downloads per month
Used in 6 crates (3 directly)

Apache-2.0

37KB
970 lines

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