Ignore:
Timestamp:
Jun 26, 2023, 12:51:06 PM (17 months ago)
Author:
chronos
Message:
  • Fixed: Generation of var function parameters.
Location:
branches/xpascal/Generators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/xpascal/Generators/GeneratorPhp.pas

    r230 r232  
    231231  AddText('function ' + FunctionDef.Name + '(');
    232232  for I := 0 to FunctionDef.Params.Count - 1 do begin
     233    if FunctionDef.Params[I].Kind = pkVar then
     234      AddText('&');
    233235    AddText('$' + TFunctionParameter(FunctionDef.Params[I]).Name);
    234236    if I > 0 then AddText(', ');
     
    240242    if FunctionDef.InternalName = 'WriteLn' then AddTextLine('echo($Text."\n");')
    241243    else if FunctionDef.InternalName = 'Write' then AddTextLine('echo($Text);')
     244    else if FunctionDef.InternalName = 'ReadLn' then AddTextLine('$Text = readline();')
     245    else if FunctionDef.InternalName = 'Read' then AddTextLine('$Text = readline();')
    242246    else if FunctionDef.InternalName = 'IntToStr' then AddTextLine('return $Value;')
    243247    else if FunctionDef.InternalName = 'StrToInt' then AddTextLine('return $Value;')
  • branches/xpascal/Generators/GeneratorXml.pas

    r231 r232  
    4242  Field: TField;
    4343  Obj: TObject;
     44  List: TSourceNodeList<TSourceNode>;
    4445begin
    45   if SourceNode = nil then begin
    46   end else
    47   if SourceNode is TSourceNodeList<TSourceNode> then begin
    48     GenerateNodes(TSourceNodeList<TSourceNode>(SourceNode))
    49   end else
    5046  if SourceNode is TSourceNode then begin
    5147    AddTextLine('<' + SourceNode.ClassName + '>');
     
    5753        if Obj is TSourceNode then
    5854          GenerateNode(TSourceNode(Obj));
     55      end else
     56      if Field.DataType = dtList then begin
     57        SourceNode.GetValue(I, List);
     58        GenerateNodes(List);
    5959      end else
    6060      if Field.DataType = dtString then begin
Note: See TracChangeset for help on using the changeset viewer.