From 5fbe7c2692a4520eb35b22c61100ea678dbdc7dd Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 17 Jul 2022 09:07:56 -0500 Subject: [PATCH] Regression: An if-condition followed by a completed if-condition is not being processed. The commit 4ddc0910eb872bf242895e1e5e804f50f671901d did not address this use case. Example: if == x x print x is x if == y y print y is y --- level_3/fake/c/private-make-operate_block.c | 10 ++++++++++ level_3/fake/c/private-make-operate_validate.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/level_3/fake/c/private-make-operate_block.c b/level_3/fake/c/private-make-operate_block.c index ecfb801..37fc960 100644 --- a/level_3/fake/c/private-make-operate_block.c +++ b/level_3/fake/c/private-make-operate_block.c @@ -10,6 +10,16 @@ extern "C" { if (state_process->block) { if (state_process->operation == fake_make_operation_type_and_e || state_process->operation == fake_make_operation_type_else_e || state_process->operation == fake_make_operation_type_if_e || state_process->operation == fake_make_operation_type_or_e) { + + if (state_process->operation == fake_make_operation_type_if_e) { + + // When another if condition follows a non-if, non-and, and non-or, then this is the start of a new condition block. + if (state_process->operation_previous != fake_make_operation_type_if_e && state_process->operation_previous != fake_make_operation_type_and_e && state_process->operation_previous != fake_make_operation_type_or_e) { + state_process->block = fake_state_process_block_operate_e; + state_process->block_result = 0; + } + } + return; } diff --git a/level_3/fake/c/private-make-operate_validate.c b/level_3/fake/c/private-make-operate_validate.c index be2dee0..e16943f 100644 --- a/level_3/fake/c/private-make-operate_validate.c +++ b/level_3/fake/c/private-make-operate_validate.c @@ -629,7 +629,7 @@ extern "C" { fake_make_operation_argument_if_mode_s, fake_make_operation_argument_if_not_s, fake_make_operation_argument_if_define_s, // If not define, represented by just "define". - fake_make_operation_argument_if_exist_s, // If not exist, represented by just "exist". + fake_make_operation_argument_if_exist_s, // If not exist, represented by just "exist". fake_make_operation_argument_if_group_s, // If not group, represented by just "group". fake_make_operation_argument_if_is_s, // If not is, represented by just "is". fake_make_operation_argument_if_mode_s, // If not mode, represented by just "mode". -- 1.8.3.1