From 94049a42a0f61ab9f3ec7a0ea109a2e0ac9edfcc Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sat, 3 Apr 2021 13:42:49 -0600 Subject: correctly inherit macros --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 668d2e2..c5240fc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,9 +61,13 @@ fn main() -> Result<()> { let mut makefile = Makefile::new(&args); for filename in &args.makefile { if filename == &PathBuf::from("-") { - makefile.extend(MakefileReader::read(&args, stdin().lock())?); + let macros = makefile.macros.with_overlay(); + let file = MakefileReader::read(&args, macros, stdin().lock())?.finish(); + makefile.extend(file); } else { - makefile.extend(MakefileReader::read_file(&args, filename)?); + let macros = makefile.macros.with_overlay(); + let file = MakefileReader::read_file(&args, macros, filename)?.finish(); + makefile.extend(file); }; } -- cgit v1.2.3