Changeset 48 for trunk/Target
- Timestamp:
- Jul 12, 2012, 9:15:02 AM (12 years ago)
- Location:
- trunk/Target
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Target/UTarget.pas
r47 r48 7 7 uses 8 8 Classes, SysUtils, StrUtils, Registry, URegistry, SpecializedList, Dialogs, 9 FileUtil, Process ;9 FileUtil, Process, Menus; 10 10 11 11 type … … 86 86 Name: string; 87 87 ProgramName: string; 88 ImageIndex: Integer; 88 89 Optimization: TCompilerOptimization; 89 90 CompilerPath: string; … … 126 127 procedure SaveToRegistry(Root: HKEY; Key: string); 127 128 function FindByName(Name: string): TTarget; 129 procedure LoadToMenuItem(MenuItem: TMenuItem; Action: TNotifyEvent; 130 CurrentTarget: TTarget); 128 131 end; 129 132 … … 286 289 if I < Count then Result := TTarget(Items[I]) 287 290 else Result := nil; 291 end; 292 293 procedure TTargetList.LoadToMenuItem(MenuItem: TMenuItem; Action: TNotifyEvent 294 ; CurrentTarget: TTarget); 295 var 296 NewMenuItem: TMenuItem; 297 I: Integer; 298 begin 299 if Assigned(MenuItem) then begin 300 MenuItem.Clear; 301 for I := 0 to Count - 1 do begin 302 NewMenuItem := TMenuItem.Create(MenuItem); 303 NewMenuItem.Caption := TTarget(Items[I]).Name; 304 NewMenuItem.OnClick := Action; 305 NewMenuItem.ImageIndex := TTarget(Items[I]).ImageIndex; 306 if TTarget(Items[I]) = CurrentTarget then NewMenuItem.Checked := True; 307 MenuItem.Add(NewMenuItem); 308 end; 309 end; 288 310 end; 289 311 -
trunk/Target/UTargetC.pas
r41 r48 32 32 SourceExtension := '.c'; 33 33 CompiledExtension := '.exe'; 34 ImageIndex := 23; 34 35 Capabilities := [tcCompile, tcRun]; 35 36 {$IFDEF Windows} -
trunk/Target/UTargetDelphi.pas
r41 r48 29 29 Name := 'Delphi'; 30 30 SourceExtension := '.pas'; 31 ImageIndex := 22; 31 32 CompiledExtension := '.exe'; 32 33 Capabilities := [tcCompile, tcRun]; … … 49 50 Inc(I) 50 51 end; 52 end; 53 54 function CheckClear: Boolean; 55 begin 56 Result := (FSourceCode[I] = '[') and (Length(FSourceCode) >= I + 2) and 57 (FSourceCode[I + 1] = '-') and (FSourceCode[I + 2] = ']'); 51 58 end; 52 59 … … 89 96 ',': AddLine('Read(ReadChar); Memory[Pos] := Ord(ReadChar);'); 90 97 '[': begin 91 AddLine('while Memory[Pos] <> 0 do begin'); 92 Inc(Indent); 98 if CheckClear then begin 99 AddLine('Memory[Pos] := 0;'); 100 Inc(I, 2); 101 end else begin 102 AddLine('while Memory[Pos] <> 0 do begin'); 103 Inc(Indent); 104 end; 93 105 end; 94 106 ']': begin -
trunk/Target/UTargetInterpretter.pas
r47 r48 447 447 inherited; 448 448 Name := 'Interpretter'; 449 ImageIndex := 25; 449 450 Capabilities := [tcRun, tcPause, tcStop, tcCompile, tcStepOut, tcStepInto, 450 451 tcStepOver, tcRunToCursor]; -
trunk/Target/UTargetJava.pas
r41 r48 31 31 SourceExtension := '.java'; 32 32 CompiledExtension := '.class'; 33 ImageIndex := 24; 33 34 Capabilities := [tcCompile, tcRun]; 34 35 {$IFDEF Windows} -
trunk/Target/UTargetPHP.pas
r42 r48 30 30 Name := 'PHP'; 31 31 SourceExtension := '.php'; 32 ImageIndex := 21; 32 33 Capabilities := [tcCompile, tcRun]; 33 34 {$IFDEF Windows}
Note:
See TracChangeset
for help on using the changeset viewer.