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/Optimizer.pas

    r231 r232  
    5555  Obj: TObject;
    5656  TempNewNode: TSourceNode;
     57  ListValue: TSourceNodeList<TSourceNode>;
    5758begin
    5859  NewNode := nil;
    59   if SourceNode = nil then begin
    60   end else
    61   if SourceNode is TSourceNodeList<TSourceNode> then begin
    62     OptimizeNodes(TSourceNodeList<TSourceNode>(SourceNode), NewNode)
    63   end else
    6460  if (ofReplaceRepeatUntilByWhileDo in Features) and (SourceNode is TRepeatUntil) then begin
    6561    WhileDo := TWhileDo.Create;
     
    113109  end else
    114110    raise Exception.Create(SUnsupportedNodeType);
     111
     112  for I := 0 to SourceNode.FieldsCount - 1 do begin
     113    Field := SourceNode.GetField(I);
     114    if Field.DataType = dtList then begin
     115      SourceNode.GetValue(I, ListValue);
     116      OptimizeNodes(TSourceNodeList<TSourceNode>(ListValue), NewNode)
     117    end;
     118  end;
    115119end;
    116120
Note: See TracChangeset for help on using the changeset viewer.