Ignore:
Timestamp:
Nov 9, 2010, 8:10:12 AM (14 years ago)
Author:
george
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/Produce/UProducerPascal.pas

    r17 r18  
    123123begin
    124124  if AType is TTypeRecord then begin
    125     EmitLn(AType.Name + ' ' + AssignSymbol + ' record');
     125    EmitLn('record');
    126126    Inc(Indetation);
    127     for I := 0 to TTypeRecord(AType).CommonBlock.Types.Count - 1 do begin
    128       GenerateType(TType(TTypeRecord(AType).CommonBlock.Types[I]));
     127    with TTypeRecord(AType).CommonBlock do
     128    for I := 0 to Variables.Count - 1 do begin
     129      Emit(Variables[I].Name + ': ');
     130      GenerateType(Variables[I].ValueType);
    129131      EmitLn(';');
    130132    end;
     
    132134    Emit('end');
    133135  end else
     136  if AType is TTypeSubRange then begin
     137    Emit(TTypeSubRange(AType).Bottom + '..' + TTypeSubRange(AType).Top);
     138  end else
    134139  if AType is TTypeArray then begin
    135     Emit(AType.Name + ' ' + AssignSymbol + ' array ');
     140    Emit('array ');
    136141    if Assigned(TTypeArray(AType).IndexType) then begin
    137142      Emit('[');
     
    142147    if Assigned(TTypeArray(AType).ItemType) then
    143148      GenerateType(TTypeArray(AType).ItemType);
     149  end else
     150  if AType is TTypePointer then begin
     151    Emit('^' + TTypePointer(AType).UsedType.Name);
    144152  end else begin
    145153    Emit(AType.Name);
    146     if Assigned(AType.UsedType) then begin
    147       Emit(' ' + AssignSymbol + ' ');
     154    if AType.Name = '' then begin
    148155      GenerateType(AType.UsedType);
    149156    end;
     
    161168    with TType(Types[I]) do
    162169    if (not Internal) then begin
    163       GenerateType(TType(Types[I]), '=');
     170      Emit(TType(Types[I]).Name + ' = ');
     171      GenerateType(TType(Types[I]));
    164172      EmitLn(';');
    165173    end;
Note: See TracChangeset for help on using the changeset viewer.