From 31a35ac86e41a698a5eafcc0b4cbfa64e2066c39 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sat, 3 Apr 2021 11:29:04 -0600 Subject: correctly handle conditional lines inside rule body --- src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 116b349..668d2e2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,17 +58,15 @@ fn main() -> Result<()> { // TODO dump command-line args into MAKEFLAGS // TODO dump command-line macros into environment // TODO add SHELL macro - let mut makefile_reader = MakefileReader::new(&args); + let mut makefile = Makefile::new(&args); for filename in &args.makefile { if filename == &PathBuf::from("-") { - makefile_reader.and_read(stdin().lock())?; + makefile.extend(MakefileReader::read(&args, stdin().lock())?); } else { - makefile_reader.and_read_file(filename)?; + makefile.extend(MakefileReader::read_file(&args, filename)?); }; } - let makefile: Makefile = makefile_reader.into(); - if args.print_everything { println!("{}", &makefile); } -- cgit v1.2.3