==================
Basic Codeunit Declaration
==================
codeunit 50100 MyCodeunit
{
}
---

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    (integer)
    (identifier)))

==================
Codeunit With Properties
==================
codeunit 50100 MyCodeunit
{
    TableNo = Customer;
    Subtype = Test;
    SingleInstance = true;
}
---

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    (integer)
    (identifier)
    (property
      (property_name)
      (identifier))
    (property
      (property_name)
      (identifier))
    (property
      (property_name)
      (boolean))))

==================
Variable Declarations
==================
codeunit 50100 MyCodeunit
{
    var
        MyInt: Integer;
        MyText: Text[50];
        MyDec: Decimal;
        MyRec: Record Customer;
        MyArr: array[10] of Text;
}
---

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    (integer)
    (identifier)
    (var_section
      (var_keyword)
      (variable_declaration
        (identifier)
        (type_specification
          (basic_type)))
      (variable_declaration
        (identifier)
        (type_specification
          (text_type
            (integer))))
      (variable_declaration
        (identifier)
        (type_specification
          (basic_type)))
      (variable_declaration
        (identifier)
        (type_specification
          (record_type
            (identifier))))
      (variable_declaration
        (identifier)
        (type_specification
          (array_type
            (integer)
            (type_specification
              (text_type))))))))

==================
Basic Procedure
==================
codeunit 50100 MyCodeunit
{
    local procedure MyProc(param1: Integer; var param2: Text): Boolean
    begin
        exit(true);
    end;
}
---

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    (integer)
    (identifier)
    (procedure
      (procedure_modifier
        (local_keyword))
      (procedure_keyword)
      (identifier)
      (parameter_list
        (parameter
          (identifier)
          (type_specification
            (basic_type)))
        (parameter
          (var_keyword)
          (identifier)
          (type_specification
            (text_type))))
      (type_specification
        (basic_type))
      (code_block
        (exit_statement
          (exit_keyword)
          (boolean))))))

==================
Basic Trigger
==================
codeunit 50100 MyCodeunit
{
    trigger OnRun()
    begin
        Message('Hello');
    end;
}
---

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    (integer)
    (identifier)
    (trigger_declaration
      (trigger_keyword)
      (identifier)
      (code_block
        (call_expression
          (identifier)
          (argument_list
            (string_literal)))))))

==================
Procedure With Var Section
==================
codeunit 50100 MyCodeunit
{
    local procedure ProcessCustomer(CustNo: Code[20])
    var
        Cust: Record Customer;
        Amount: Decimal;
    begin
        Cust.Get(CustNo);
        Amount := Cust."Balance (LCY)";
    end;
}
---

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    (integer)
    (identifier)
    (procedure
      (procedure_modifier
        (local_keyword))
      (procedure_keyword)
      (identifier)
      (parameter_list
        (parameter
          (identifier)
          (type_specification
            (code_type
              (integer)))))
      (var_section
        (var_keyword)
        (variable_declaration
          (identifier)
          (type_specification
            (record_type
              (identifier))))
        (variable_declaration
          (identifier)
          (type_specification
            (basic_type))))
      (code_block
        (call_expression
          (member_expression
            (identifier)
            (identifier))
          (argument_list
            (identifier)))
        (assignment_statement
          (identifier)
          (member_expression
            (identifier)
            (quoted_identifier)))))))
