From 64ba56eda176e22351331c76d78a7238c6e7189f Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Tue, 6 Apr 2021 15:23:21 -0600 Subject: handle else ifs correctly --- src/makefile/conditional.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/makefile/conditional.rs') diff --git a/src/makefile/conditional.rs b/src/makefile/conditional.rs index 989dfc9..95cab9e 100644 --- a/src/makefile/conditional.rs +++ b/src/makefile/conditional.rs @@ -168,7 +168,10 @@ impl Line { StateAction::Replace(State::SkippingUntilEndIf) } Some(State::SkippingUntilElseOrEndIf) => { - inner_condition.action(current_state, is_macro_defined, expand_macro)? + match inner_condition.action(current_state, is_macro_defined, expand_macro)? { + StateAction::Push(x) => StateAction::Replace(x), + x => x, + } } None => bail!("got an ElseIf but not in a conditional"), }, -- cgit v1.2.3