diff options
Diffstat (limited to 'src/makefile/macro.rs')
-rw-r--r-- | src/makefile/macro.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/makefile/macro.rs b/src/makefile/macro.rs index 43aff90..a6dcb74 100644 --- a/src/makefile/macro.rs +++ b/src/makefile/macro.rs @@ -103,6 +103,7 @@ impl<'parent, 'lookup> Set<'parent, 'lookup> { match token { Token::Text(t) => result.push_str(t), Token::MacroExpansion { name, replacement } => { + let name = self.expand(name)?; let internal_macro_names = &['@', '?', '<', '*'][..]; let internal_macro_suffices = &['D', 'F'][..]; let just_internal = name.len() == 1 && name.starts_with(internal_macro_names); @@ -110,9 +111,9 @@ impl<'parent, 'lookup> Set<'parent, 'lookup> { && name.starts_with(internal_macro_names) && name.ends_with(internal_macro_suffices); let macro_value = if just_internal || suffixed_internal { - self.lookup_internal(name)? + self.lookup_internal(&name)? } else { - self.get(name).map_or_else( + self.get(&name).map_or_else( || { log::warn!("undefined macro {}", name); Ok(String::new()) @@ -139,8 +140,9 @@ impl<'parent, 'lookup> Set<'parent, 'lookup> { } #[cfg(feature = "full")] Token::FunctionCall { name, args } => { + let name = self.expand(name)?; let fn_result = - functions::expand_call(name, args, self, Some(Rc::clone(&self.to_eval)))?; + functions::expand_call(&name, args, self, Some(Rc::clone(&self.to_eval)))?; log::trace!("expanded {} into \"{}\"", token, &fn_result); result.push_str(&fn_result); } |