- Timestamp:
- Jul 12, 2012, 9:56:58 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r48 r49 1 1 object MainForm: TMainForm 2 Left = 2 362 Left = 223 3 3 Height = 430 4 Top = 1 444 Top = 176 5 5 Width = 670 6 6 Caption = 'LazFuck' -
trunk/Target/UTargetPHP.pas
r48 r49 57 57 end; 58 58 59 function CheckClear: Boolean; 60 begin 61 Result := (FSourceCode[I] = '[') and (Length(FSourceCode) >= I + 2) and 62 (FSourceCode[I + 1] = '-') and (FSourceCode[I + 2] = ']'); 63 end; 64 59 65 begin 60 66 inherited; … … 66 72 AddLine('$Memory = str_repeat("\0", 30000);'); 67 73 AddLine('$Position = 0;'); 68 for I := 1 to Length(FSourceCode) do begin 74 I := 1; 75 while (I <= Length(FSourceCode)) do begin 69 76 case FSourceCode[I] of 70 77 '>': begin … … 87 94 ',': AddLine('$Memory[$Position] = fgetc(STDIN);'); 88 95 '[': begin 89 AddLine('while($Memory[$Position] != "\0") {'); 90 Inc(Indent); 96 if CheckClear then begin 97 AddLine('$Memory[$Position] = "\0";'); 98 Inc(I, 2); 99 end else begin 100 AddLine('while($Memory[$Position] != "\0") {'); 101 Inc(Indent); 102 end; 91 103 end; 92 104 ']': begin … … 95 107 end; 96 108 end; 109 Inc(I); 97 110 end; 98 111 AddLine('');
Note:
See TracChangeset
for help on using the changeset viewer.