aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/macro.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-05 16:09:12 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-05 16:09:12 -0600
commitfc83bbbdd51b82fad6293f06c377be0409d6db26 (patch)
tree85eab9d2d72008ee9c1268056dde5e87b7ebb642 /src/makefile/macro.rs
parent5574b575eb09d8121d870fbabe46e7606e6c81eb (diff)
downloadmakers-fc83bbbdd51b82fad6293f06c377be0409d6db26.tar.gz
makers-fc83bbbdd51b82fad6293f06c377be0409d6db26.zip
allow for fucking horrifying crimes
fuck you linux for making me support this after all
Diffstat (limited to 'src/makefile/macro.rs')
-rw-r--r--src/makefile/macro.rs8
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);
}