Ignore:
Timestamp:
Jan 18, 2018, 1:30:58 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Now arrays of string and integer are supported and executed correctly by executor.
  • Added: IfNotEqual command.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/easy compiler/USourceGenerator.pas

    r148 r149  
    120120    Result := Result + IndentStr + 'repeat' + LineEnding;
    121121    Inc(Indent);
    122     Result := Result + IndentStr +  GenerateCommand(TCommandRepeat(Command).Command) + LineEnding;
     122    Result := Result + GenerateCommand(TCommandRepeat(Command).Command);
    123123    Dec(Indent);
    124124    Result := Result + IndentStr + 'until False;' + LineEnding;
    125125  end else
    126126  if Command is TCommandIfEqual then begin
    127     Result := Result + IndentStr + 'if ' + GenerateRef(TCommandIfEqual(Command).Reference1) +
    128       ' = ' + GenerateRef(TCommandIfEqual(Command).Reference2) + ' then ';
     127    Result := Result + IndentStr + 'if ' +
     128      GenerateRef(TCommandIfEqual(Command).Reference1) + ' = ' +
     129      GenerateRef(TCommandIfEqual(Command).Reference2) + ' then ' + LineEnding;
     130  end else
     131  if Command is TCommandIfNotEqual then begin
     132    Result := Result + IndentStr + 'if ' +
     133      GenerateRef(TCommandIfNotEqual(Command).Reference1) + ' <> ' +
     134      GenerateRef(TCommandIfNotEqual(Command).Reference2) + ' then ' + LineEnding;
    129135  end else
    130136  raise Exception.Create('Unsupported instruction');
Note: See TracChangeset for help on using the changeset viewer.