From 68ebea2da2b178f740f4e0682ff1a8857adaaa3b Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Fri, 2 Apr 2021 20:53:16 -0600 Subject: don't skip over endif while waiting for endif oops --- src/makefile/mod.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs index 75805f6..5f4ca15 100644 --- a/src/makefile/mod.rs +++ b/src/makefile/mod.rs @@ -188,6 +188,17 @@ impl<'a> Makefile<'a> { } let line = COMMENT.replace(&line, "").into_owned(); + #[cfg(feature = "full")] + if let Some(line) = ConditionalLine::from(&line, |t| self.expand_macros(t, None))? { + line.action( + conditional_stack.last(), + |name| self.macros.is_defined(name), + |t| self.expand_macros(t, None), + )? + .apply_to(&mut conditional_stack); + continue; + } + // skip lines if we need to #[cfg(feature = "full")] if conditional_stack @@ -211,16 +222,6 @@ impl<'a> Makefile<'a> { continue; } - #[cfg(feature = "full")] - if let Some(line) = ConditionalLine::from(&line, |t| self.expand_macros(t, None))? { - line.action( - conditional_stack.last(), - |name| self.macros.is_defined(name), - |t| self.expand_macros(t, None), - )? - .apply_to(&mut conditional_stack); - continue; - } if line.trim().is_empty() { // handle blank lines continue; -- cgit v1.2.3