Changeset 16


Ignore:
Timestamp:
Feb 11, 2012, 7:12:30 PM (13 years ago)
Author:
chronos
Message:
  • Added: Function for formating source using text indentation according loop nesting.
Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Languages/LazFuckIDE.cs.po

    r15 r16  
    1313#, fuzzy
    1414#| msgid "Runtime"
     15msgctxt "tinterpreterform.caption"
    1516msgid "Interpretter"
    1617msgstr "Běh"
     
    7172msgstr "O programu"
    7273
    73 #: tmainform.abreakpointset.caption
    74 msgid "Breakpoint set"
    75 msgstr "Nastavit bod přeruÅ¡ení"
    76 
    77 #: tmainform.abreakpointunset.caption
    78 msgid "Unset breakpoint"
    79 msgstr "ZruÅ¡it bod přeruÅ¡ení"
     74#: tmainform.abreakpointtoggle.caption
     75msgid "Toggle breakpoint"
     76msgstr ""
    8077
    8178#: tmainform.acompile.caption
     
    8683msgid "Exit"
    8784msgstr "Ukončit"
     85
     86#: tmainform.aformatsource.caption
     87msgid "Format source"
     88msgstr ""
    8889
    8990#: tmainform.ahelp.caption
     
    150151
    151152#: tmainform.aviewinterpretter.caption
     153msgctxt "tmainform.aviewinterpretter.caption"
    152154msgid "Interpretter"
    153155msgstr "Interpretr"
     
    179181msgstr ""
    180182
     183#: tmainform.menuitem24.caption
     184msgid "Tools"
     185msgstr ""
     186
    181187#: tmainform.menuitem40.caption
    182188msgid "Target"
  • trunk/Languages/LazFuckIDE.po

    r15 r16  
    33
    44#: tinterpreterform.caption
     5msgctxt "tinterpreterform.caption"
    56msgid "Interpretter"
    67msgstr ""
     
    6162msgstr ""
    6263
    63 #: tmainform.abreakpointset.caption
    64 msgid "Breakpoint set"
    65 msgstr ""
    66 
    67 #: tmainform.abreakpointunset.caption
    68 msgid "Unset breakpoint"
     64#: tmainform.abreakpointtoggle.caption
     65msgid "Toggle breakpoint"
    6966msgstr ""
    7067
     
    7572#: tmainform.aexit.caption
    7673msgid "Exit"
     74msgstr ""
     75
     76#: tmainform.aformatsource.caption
     77msgid "Format source"
    7778msgstr ""
    7879
     
    140141
    141142#: tmainform.aviewinterpretter.caption
     143msgctxt "tmainform.aviewinterpretter.caption"
    142144msgid "Interpretter"
    143145msgstr ""
     
    169171msgstr ""
    170172
     173#: tmainform.menuitem24.caption
     174msgid "Tools"
     175msgstr ""
     176
    171177#: tmainform.menuitem40.caption
    172178msgid "Target"
  • trunk/UApplicationInfo.pas

    r4 r16  
    5353  Name := 'LazFuck';
    5454  Identification := 1;
    55   ReleaseDate := EncodeDate(2012, 2, 9);
     55  ReleaseDate := EncodeDate(2012, 2, 11);
    5656  MajorVersion := 0;
    5757  MinorVersion := 1;
  • trunk/UMainForm.lfm

    r15 r16  
    2828    OnMouseDown = MemoSourceMouseDown
    2929    ParentFont = False
     30    PopupMenu = PopupMenuSource
    3031    ScrollBars = ssAutoBoth
    3132    TabOrder = 0
     
    99100      Action = AOptions
    100101    end
     102    object ToolButton9: TToolButton
     103      Left = 172
     104      Top = 2
     105      Action = ABreakpointToggle
     106    end
    101107  end
    102108  object TabControl1: TTabControl
     
    519525          0000000000000000000000000000000000000000000000000000
    520526        }
     527      end
     528    end
     529    object MenuItem24: TMenuItem
     530      Caption = 'Tools'
     531      object MenuItem25: TMenuItem
     532        Action = AFormatSource
    521533      end
    522534    end
     
    702714      Caption = 'Step out'
    703715    end
    704     object ABreakpointSet: TAction
    705       Caption = 'Breakpoint set'
    706     end
    707     object ABreakpointUnset: TAction
    708       Caption = 'Unset breakpoint'
     716    object ABreakpointToggle: TAction
     717      Caption = 'Toggle breakpoint'
     718      ImageIndex = 12
     719      OnExecute = ABreakpointToggleExecute
    709720    end
    710721    object AOptions: TAction
     
    712723      ImageIndex = 2
    713724      OnExecute = AOptionsExecute
     725    end
     726    object AFormatSource: TAction
     727      Caption = 'Format source'
     728      OnExecute = AFormatSourceExecute
    714729    end
    715730  end
     
    718733    top = 96
    719734    Bitmap = {
    720       4C690C0000001000000010000000000000000000000000000000000000000000
     735      4C690D0000001000000010000000000000000000000000000000000000000000
    721736      0000000000000000000000000000000000000000000000000000000000000000
    722737      000000000000000000000000000000000000000000FF000000FF000000FF0000
     
    11021117      0000000000000000000000000000000000000000000000000000000000000000
    11031118      0000000000000000000000000000000000000000000000000000000000000000
    1104       0000000000000000000000000000
     1119      0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1120      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1121      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1122      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1123      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000A4000000A6000000
     1124      A9200000AA7E0000AAB20000AAC80000AAB20000AA7E0000A9200000A6000000
     1125      A400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000A4000000A6410A0A
     1126      AEC13F3FD5E76060EDF86A6AF3FE6060ECF83E3ED4E70A0AADC10000A6410000
     1127      A400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000A3200A0AABC15555
     1128      E3F35A5AE2FF5656DEFF5656DEFF5656DEFF5959E1FF5050DEF30909AAC10000
     1129      A320FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000009E7E3939CCE64A4A
     1130      D2FF4545CDFF4545CDFF4545CDFF4545CDFF4545CDFF4848D0FF3131C3E60000
     1131      9E7EFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000009AB24A4AD4F83737
     1132      BFFF3737BFFF3131BAFF2727B0FF1C1CA6FF1616A0FF12129CFF2323AEF80000
     1133      9AB2FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000095C84848D0FE2E2E
     1134      B8FF1D1DADFF1212A5FF1111A4FF1111A4FF1111A4FF1111A4FF1B1BADFE0000
     1135      95C8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000008FB23434C3F81414
     1136      B2FF1111B1FF1111B1FF1111B1FF1111B1FF1111B1FF1111B1FF1414B0F80000
     1137      8FB2FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000897E1818AFE61414
     1138      C1FF1111BFFF1111BFFF1111BFFF1111BFFF1111BFFF1111BFFF0A0AA6E60000
     1139      897EFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000008420030389C11515
     1140      BFF31212CDFF1111CCFF1111CCFF1111CCFF1111CCFF0E0EBCF3020288C10000
     1141      8420FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000008100000078410202
     1142      7DC10A0AA8E70F0FCAF81111D5FE0F0FCAF80A0AA8E702027DC1000078410000
     1143      8100FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000008100000075000000
     1144      64200000607E000060B2000060C8000060B20000607E00006420000075000000
     1145      8100FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1146      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1147      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1148      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1149      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1150      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1151      FF00FFFFFF00FFFFFF00FFFFFF00
    11051152    }
    11061153  end
     
    11221169    top = 216
    11231170  end
     1171  object PopupMenuSource: TPopupMenu
     1172    Images = ImageList1
     1173    left = 128
     1174    top = 126
     1175    object MenuItem23: TMenuItem
     1176      Action = ABreakpointToggle
     1177    end
     1178  end
    11241179end
  • trunk/UMainForm.lrt

    r15 r16  
    77TMAINFORM.MENUITEM21.CAPTION=New Item21
    88TMAINFORM.MENUITEM17.CAPTION=-
     9TMAINFORM.MENUITEM24.CAPTION=Tools
    910TMAINFORM.MENUITEM18.CAPTION=View
    1011TMAINFORM.MENUITEM10.CAPTION=Help
     
    2728TMAINFORM.AINTERPRETTERRUNTOCURSOR.CAPTION=Run to cursor
    2829TMAINFORM.AINTERPRETTERSTEPOUT.CAPTION=Step out
    29 TMAINFORM.ABREAKPOINTSET.CAPTION=Breakpoint set
    30 TMAINFORM.ABREAKPOINTUNSET.CAPTION=Unset breakpoint
     30TMAINFORM.ABREAKPOINTTOGGLE.CAPTION=Toggle breakpoint
    3131TMAINFORM.AOPTIONS.CAPTION=Options
     32TMAINFORM.AFORMATSOURCE.CAPTION=Format source
  • trunk/UMainForm.pas

    r15 r16  
    77uses
    88  Classes, SysUtils, FileUtil, SynEdit, Forms, Controls, Graphics, Dialogs,
    9   Menus, ActnList, StdCtrls, ComCtrls, UBrainFuck, UCoolTranslator,
     9  Menus, ActnList, StdCtrls, ComCtrls, UBrainFuck, UCoolTranslator, StrUtils,
    1010  SpecializedList;
    1111
     
    1717    ACompile: TAction;
    1818    AAbout: TAction;
    19     ABreakpointSet: TAction;
    20     ABreakpointUnset: TAction;
     19    ABreakpointToggle: TAction;
     20    AFormatSource: TAction;
    2121    AOptions: TAction;
    2222    AInterpretterStepOut: TAction;
     
    5555    MenuItem20: TMenuItem;
    5656    MenuItem22: TMenuItem;
     57    MenuItem23: TMenuItem;
     58    MenuItem24: TMenuItem;
     59    MenuItem25: TMenuItem;
    5760    MenuItem40: TMenuItem;
    5861    MenuItem21: TMenuItem;
     
    6568    MenuItem9: TMenuItem;
    6669    OpenDialog1: TOpenDialog;
     70    PopupMenuSource: TPopupMenu;
    6771    SaveDialog1: TSaveDialog;
    6872    StatusBar1: TStatusBar;
     
    7781    ToolButton7: TToolButton;
    7882    ToolButton8: TToolButton;
     83    ToolButton9: TToolButton;
     84    procedure ABreakpointToggleExecute(Sender: TObject);
    7985    procedure ACompileExecute(Sender: TObject);
    8086    procedure AExitExecute(Sender: TObject);
     87    procedure AFormatSourceExecute(Sender: TObject);
    8188    procedure AOptionsExecute(Sender: TObject);
    8289    procedure AProgramPauseExecute(Sender: TObject);
     
    230237end;
    231238
     239procedure TMainForm.AFormatSourceExecute(Sender: TObject);
     240var
     241  Source: string;
     242  NewSource: string;
     243  Indent: Integer;
     244  I: Integer;
     245const
     246  IndentText = '  ';
     247begin
     248  Source := MemoSource.Text;
     249  NewSource := '';
     250  Indent := 0;
     251  for I := 1 to Length(Source) do begin
     252    if Source[I] = '[' then begin
     253      NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding ;
     254      Inc(Indent);
     255      NewSource := NewSource + DupeString(IndentText, Indent);
     256    end
     257    else if Source[I] = ']' then begin
     258      Dec(Indent);
     259      NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding + DupeString(IndentText, Indent);
     260    end
     261    else if Ord(Source[I]) > $20 then
     262      NewSource := NewSource + Source[I];
     263  end;
     264  MemoSource.Text := NewSource;
     265end;
     266
    232267procedure TMainForm.AOptionsExecute(Sender: TObject);
    233268begin
     
    245280  CompiledForm.MemoCompiled.Text := BrainFuckCompiler.Output;
    246281  CompiledForm.Show;
     282end;
     283
     284procedure TMainForm.ABreakpointToggleExecute(Sender: TObject);
     285begin
     286  //BreakPoints.Add();
    247287end;
    248288
Note: See TracChangeset for help on using the changeset viewer.