================================================================================
KNOWN LIMITATION: Trigger with preprocessor in var and fragmented if-else in body
================================================================================

// This pattern creates parsing ambiguity because:
// 1. The preproc_conditional_statements starts with #if on line 14
// 2. Inside it, there's a preproc_fragmented_if_else that consumes multiple #endif/#if pairs
// 3. The fragmented pattern interferes with normal preprocessor nesting
// 4. After the fragmented if-else, the parser cannot correctly determine scope boundaries
// This results in ERROR nodes as the parser tries to parse the trigger's closing 'end;'
// and subsequent var section as statements within the preprocessor block.

table 5880 "Test Table"
{
    trigger OnDelete()
    var
#if not CLEAN24
        OldRecord: Record "Old Record";
#endif
        NewRecord: Record "New Record";
    begin
#if not CLEAN24
        if not TestCondition() then begin
            OldRecord.Reset();
            OldRecord.DeleteAll();
        end else begin
#endif
            NewRecord.Reset();
            NewRecord.DeleteAll();
#if not CLEAN24
        end;
#endif
    end;
    
    var
        GlobalVar: Integer;
#if not CLEAN24
        OldGlobalVar: Codeunit "Old Codeunit";
#endif
}

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

(source_file
  (comment)
  (comment)
  (comment)
  (comment)
  (comment)
  (comment)
  (comment)
  (table_declaration
    object_id: (integer)
    object_name: (quoted_identifier)
    (named_trigger
      (var_section
        (preproc_conditional_variables
          (preproc_if
            condition: (preproc_not_expression
              (identifier)))
          (variable_declaration
            name: (identifier)
            type: (type_specification
              (record_type
                reference: (quoted_identifier))))
          (preproc_endif))
        (variable_declaration
          name: (identifier)
          type: (type_specification
            (record_type
              reference: (quoted_identifier)))))
      (code_block
        (preproc_conditional_statements
          (preproc_if
            condition: (preproc_not_expression
              (identifier)))
          (if_statement
            (preproc_fragmented_if_else
              condition: (unary_expression
                operator: (unary_operator)
                operand: (call_expression
                  function: (identifier)
                  arguments: (argument_list)))
              then_branch: (code_block
                (call_expression
                  function: (member_expression
                    object: (identifier)
                    property: (identifier))
                  arguments: (argument_list))
                (call_expression
                  function: (member_expression
                    object: (identifier)
                    property: (identifier))
                  arguments: (argument_list)))
              (preproc_endif)
              (call_expression
                function: (member_expression
                  object: (identifier)
                  property: (identifier))
                arguments: (argument_list))
              (call_expression
                function: (member_expression
                  object: (identifier)
                  property: (identifier))
                arguments: (argument_list))
              (preproc_if
                condition: (preproc_not_expression
                  (identifier)))
              (preproc_endif)))
          (identifier)
          (identifier)
          (identifier)
          (ERROR
            (identifier))
          (ERROR
            (preproc_if
              condition: (preproc_not_expression
                (identifier)))
            (identifier)
            (identifier))
          (empty_statement)
          (preproc_endif))
        (MISSING "_unquoted_variable_name_token7")))))
