From: Kevin Day Date: Sun, 17 Jul 2022 14:07:56 +0000 (-0500) Subject: Regression: An if-condition followed by a completed if-condition is not being processed. X-Git-Tag: 0.6.0~49 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=5fbe7c2692a4520eb35b22c61100ea678dbdc7dd;p=fll 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 --- 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".