From fbbcf325b8bbe72f924da6a7cdb128d973ef0026 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Mon, 11 Nov 2024 14:46:19 -0700 Subject: fix conditional assignment when original is inherited --- src/makefile/macro.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/makefile/macro.rs') diff --git a/src/makefile/macro.rs b/src/makefile/macro.rs index 301173a..b2a1510 100644 --- a/src/makefile/macro.rs +++ b/src/makefile/macro.rs @@ -119,7 +119,8 @@ impl Set { } } - pub fn get(&self, name: &str) -> Option<&Macro> { + /// To properly process inherited macros, use [MacroScopeStack::get]. + pub fn get_non_recursive(&self, name: &str) -> Option<&Macro> { self.data.get(name) } @@ -127,17 +128,6 @@ impl Set { self.data.insert(name, r#macro); } - #[cfg(feature = "full")] - pub fn is_defined(&self, name: &str) -> bool { - self.get(name).map_or(false, |x| !x.text.is_empty()) - } - - // `remove` is fine, but I think for "remove-and-return" `pop` is better - pub fn pop(&mut self, name: &str) -> Option { - // TODO figure out a better way to handle inheritance - self.data.remove(name) - } - pub fn extend( &mut self, other: HashMap, -- cgit v1.2.3