diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-03 13:42:49 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-03 13:42:49 -0600 |
commit | 94049a42a0f61ab9f3ec7a0ea109a2e0ac9edfcc (patch) | |
tree | e1252c7ba2b863fec75469de25b898199c19cc23 /src/main.rs | |
parent | 101c96b03ecf180af986bc20b7161b0933ae47cf (diff) | |
download | makers-94049a42a0f61ab9f3ec7a0ea109a2e0ac9edfcc.tar.gz makers-94049a42a0f61ab9f3ec7a0ea109a2e0ac9edfcc.zip |
correctly inherit macros
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 6 insertions, 2 deletions
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); }; } |