]> Kevux Git Server - fll/commitdiff
Regression: An if-condition followed by a completed if-condition is not being processed.
authorKevin Day <thekevinday@gmail.com>
Sun, 17 Jul 2022 14:07:56 +0000 (09:07 -0500)
committerKevin Day <thekevinday@gmail.com>
Sun, 17 Jul 2022 14:07:56 +0000 (09:07 -0500)
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
level_3/fake/c/private-make-operate_validate.c

index ecfb801aa70fa64e217a8ce9604dd63337aa36c6..37fc960414de77a8397acb9b16133794265a848c 100644 (file)
@@ -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;
       }
 
index be2dee00ec3edde3e60cc9da88c5cd2d0e97ee56..e16943f871f3014ea395bdc3e9465878d9325c4e 100644 (file)
@@ -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".