================================================================================
Preprocessor fragmented if-else inside repeat-until loop
================================================================================

codeunit 50000 "Test"
{
    procedure Test()
    var
        Buffer: Record "Test" temporary;
        Mgt: Codeunit "Mgt";
    begin
#if not CLEAN24
        if not Mgt.IsEnabled() then begin
            Buffer.Reset();
            if Buffer.Find('-') then
                repeat
                    Buffer.Quantity := Buffer.RecordedQty - Buffer.ExpectedQty;
                    Buffer.Modify();
                until Buffer.Next() = 0;
        end else begin
#endif
            Buffer.Reset();
            if Buffer.Find('-') then
                repeat
                    Buffer.Quantity := Buffer.RecordedQty - Buffer.ExpectedQty;
                    Buffer.Modify();
                until Buffer.Next() = 0;
#if not CLEAN24
        end;
#endif
    end;
}

--------------------------------------------------------------------------------

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (procedure
      (procedure_keyword)
      name: (identifier)
      (var_section
        (var_keyword)
        (variable_declaration
          name: (identifier)
          type: (type_specification
            (record_type
              reference: (quoted_identifier)
              (temporary_keyword))))
        (variable_declaration
          name: (identifier)
          type: (type_specification
            (object_reference_type
              object_type: (codeunit_keyword)
              reference: (quoted_identifier)))))
      (code_block
        (preproc_split_if_else_statement
          (preproc_if
            condition: (preproc_not_expression
              (identifier)))
          (if_keyword)
          condition: (unary_expression
            operand: (call_expression
              function: (member_expression
                object: (identifier)
                member: (identifier))
              arguments: (argument_list)))
          (then_keyword)
          then_branch: (code_block
            (call_expression
              function: (member_expression
                object: (identifier)
                member: (identifier))
              arguments: (argument_list))
            (if_statement
              (if_keyword)
              condition: (call_expression
                function: (member_expression
                  object: (identifier)
                  member: (identifier))
                arguments: (argument_list
                  (string_literal)))
              (then_keyword)
              then_branch: (repeat_statement
                (repeat_keyword)
                (assignment_statement
                  left: (member_expression
                    object: (identifier)
                    member: (identifier))
                  right: (additive_expression
                    left: (member_expression
                      object: (identifier)
                      member: (identifier))
                    right: (member_expression
                      object: (identifier)
                      member: (identifier))))
                (call_expression
                  function: (member_expression
                    object: (identifier)
                    member: (identifier))
                  arguments: (argument_list))
                (until_keyword)
                condition: (comparison_expression
                  left: (call_expression
                    function: (member_expression
                      object: (identifier)
                      member: (identifier))
                    arguments: (argument_list))
                  operator: (comparison_operator)
                  right: (integer)))))
          (else_keyword)
          (preproc_fragmented_else_tail
            (preproc_endif)
            (call_expression
              function: (member_expression
                object: (identifier)
                member: (identifier))
              arguments: (argument_list))
            (if_statement
              (if_keyword)
              condition: (call_expression
                function: (member_expression
                  object: (identifier)
                  member: (identifier))
                arguments: (argument_list
                  (string_literal)))
              (then_keyword)
              then_branch: (repeat_statement
                (repeat_keyword)
                (assignment_statement
                  left: (member_expression
                    object: (identifier)
                    member: (identifier))
                  right: (additive_expression
                    left: (member_expression
                      object: (identifier)
                      member: (identifier))
                    right: (member_expression
                      object: (identifier)
                      member: (identifier))))
                (call_expression
                  function: (member_expression
                    object: (identifier)
                    member: (identifier))
                  arguments: (argument_list))
                (until_keyword)
                condition: (comparison_expression
                  left: (call_expression
                    function: (member_expression
                      object: (identifier)
                      member: (identifier))
                    arguments: (argument_list))
                  operator: (comparison_operator)
                  right: (integer))))
            (preproc_if
              condition: (preproc_not_expression
                (identifier)))
            (preproc_endif)))))))
