Ignore:
Timestamp:
Jun 26, 2023, 12:51:06 PM (17 months ago)
Author:
chronos
Message:
  • Fixed: Generation of var function parameters.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/xpascal/SourceNode.pas

    r231 r232  
    88type
    99  TDataType = (dtNone, dtString, dtBoolean, dtInteger, dtFloat, dtColor,
    10     dtTime, dtDate, dtDateTime, dtEnumeration, dtObject);
     10    dtTime, dtDate, dtDateTime, dtEnumeration, dtObject, dtList);
    1111
    1212  { TField }
     
    4747  { TSourceNodeList }
    4848
    49   TSourceNodeList<T> = class(TSourceNode)
     49  TSourceNodeList<T: TSourceNode> = class(TObjectList<T>)
    5050  private
    5151    Parent: TSourceNode;
    52     function GetCount: Integer;
    53     function GetItem(Index: Integer): T;
    54     procedure SetItem(Index: Integer; AValue: T);
    55   public
    56     List: TObjectList<TSourceNode>;
    57     procedure Clear;
    58     function Add(AObject: T): Integer;
    59     constructor Create;
    60     destructor Destroy; override;
    61     property Items[Index: Integer]: T read GetItem write SetItem; default;
    62     property Count: Integer read GetCount;
    6352  end;
    6453
     
    7564  DataTypeStr: array[TDataType] of string = ('None', 'String', 'Boolean',
    7665    'Integer', 'Float', 'Color', 'Time', 'Date', 'DateTime', 'Enumeration',
    77     'Reference');
     66    'Reference', 'List');
    7867
    7968{ TField }
     
    8372  DataType := ADataType;
    8473  Name := AName;
    85 end;
    86 
    87 { TSourceNodeList }
    88 
    89 function TSourceNodeList<T>.GetCount: Integer;
    90 begin
    91   Result := List.Count;
    92 end;
    93 
    94 function TSourceNodeList<T>.GetItem(Index: Integer): T;
    95 begin
    96   Result := T(List[Index]);
    97 end;
    98 
    99 procedure TSourceNodeList<T>.SetItem(Index: Integer; AValue: T);
    100 begin
    101   List[Index] := AValue;
    102 end;
    103 
    104 procedure TSourceNodeList<T>.Clear;
    105 begin
    106   List.Clear;
    107 end;
    108 
    109 function TSourceNodeList<T>.Add(AObject: T): Integer;
    110 begin
    111   Result := List.Add(AObject);
    112 end;
    113 
    114 constructor TSourceNodeList<T>.Create;
    115 begin
    116   List := TObjectList<TSourceNode>.Create;
    117 end;
    118 
    119 destructor TSourceNodeList<T>.Destroy;
    120 begin
    121   FreeAndNil(List);
    122   inherited;
    12374end;
    12475
Note: See TracChangeset for help on using the changeset viewer.