Changeset 21


Ignore:
Timestamp:
Nov 9, 2010, 2:08:55 PM (13 years ago)
Author:
george
Message:
  • Modified: Project saving.
Location:
trunk
Files:
5 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/Analyze/UAnalyzerPascal.pas

    r20 r21  
    7979  SInvalidAssignmentValue = 'Invalid assignment "%s".';
    8080  SParamDiffers = 'Declaration of parametr "%s" differs.';
     81  SNotRecordOrClass = '"%s" not record or class';
    8182
    8283implementation
     
    257258            if Assigned(UseFunction) then begin
    258259              // Record or class functions
    259               ParseExpressionFunctionCall(SourceCode, Expressions, FunctionCall);
    260               NewExpression := TExpression.Create;
    261               NewExpression.CommonBlock := SourceCode.CommonBlock;
    262               NewExpression.NodeType := ntFunction;
    263               NewExpression.FunctionCall := FunctionCall;
     260              if ParseExpressionFunctionCall(SourceCode, Expressions, FunctionCall) then begin
     261                NewExpression := TExpression.Create;
     262                NewExpression.CommonBlock := SourceCode.CommonBlock;
     263                NewExpression.NodeType := ntFunction;
     264                NewExpression.FunctionCall := FunctionCall;
     265              end;
    264266            end;
    265267          end;
     
    336338var
    337339  UseFunction: TFunction;
     340  UseType: TType;
    338341  NewExpression: TExpression;
    339342  I: Integer;
     
    544547      if Section = cbsConstant then begin
    545548        ParseConstant(Constants);
    546       end else begin
     549      end else
     550      if NextToken = 'initialization' then Break
     551      else if NextToken = 'finalization' then Break
     552      else begin
    547553        ErrorMessage(SInvalidConstruction, [NextToken]);
    548554        ReadToken;
     
    676682      UseFunction.Name := UseName;
    677683      UseFunction.FunctionType := FunctionType;
     684      UseFunction.Exported := Exported;
    678685      Add(UseFunction);
     686      UseFunction.Parent.Order.Add(UseFunction);
    679687      ValidParams := False;
    680688    end;
     
    690698        NewValueType := Parent.Types.Search(TypeName);
    691699        if not Assigned(NewValueType) then
    692           ErrorMessage(SUndefinedType, [TypeName], -1);
    693 (*        else
     700          ErrorMessage(SUndefinedType, [TypeName], -1)
     701        else
    694702          begin
    695703            ResultType := NewValueType;
    696             with TVariable(Parent.Variables.Items[Parent.Variables.Add(
     704            with TVariable(Variables.Items[Variables.Add(
    697705                TVariable.Create)]) do
    698706            begin
     
    700708              ValueType := NewValueType;
    701709            end;
    702           end;  *)
     710          end;
    703711      end;
    704712      Expect(';');
     
    12541262        TTypeArray(NewType).IndexType := TypeList.Parent.Types.Search(UseName);
    12551263        if not Assigned(TTypeArray(NewType).IndexType) then
    1256           ErrorMessage(SUndefinedType, [UseName], -1) else
    1257           TTypeArray(NewType).IndexType := UseType;
     1264          ErrorMessage(SUndefinedType, [UseName], -1);
    12581265      end else
    12591266      if NextTokenType = ttConstantNumber then begin
  • trunk/Compiler/Produce/UProducerPascal.pas

    r19 r21  
    454454  Section: TCommonBlockSection;
    455455begin
     456  Inc(Indetation);
    456457  with CommonBlock do begin
    457458    for I := 0 to Order.Count - 1 do begin
     
    459460        if Section <> cbsType then begin
    460461          EmitLn;
     462          Dec(Indetation);
    461463          EmitLn('type');
     464          Inc(Indetation);
    462465        end;
    463466        Emit(TType(Order[I]).Name + ' = ');
     
    469472        if Section <> cbsVariable then begin
    470473          EmitLn;
     474          Dec(Indetation);
    471475          EmitLn('var');
     476          Inc(Indetation);
    472477        end;
    473478        GenerateVariable(TVariable(Order[I]));
     
    477482        if Section <> cbsConstant then begin
    478483          EmitLn;
     484          Dec(Indetation);
    479485          EmitLn('const');
     486          Inc(Indetation);
    480487        end;
    481488        GenerateConstant(TConstant(Order[I]));
     
    488495    GenerateBeginEnd(Code);
    489496  end;
     497  Dec(Indetation);
    490498end;
    491499
  • trunk/Demos/Structure

    • Property svn:ignore set to
      Compiled
  • trunk/Demos/Structure/Project.pas

    r15 r21  
    11program Project;
    22
    3 uses System, Crt;
     3uses System;
    44
    55type
     6 
     7  TPercent = 0..100;
     8 
    69  TPoint = record
    710    X: Integer;
  • trunk/Demos/Structure/System.pas

    r15 r21  
    33interface
    44
     5const
     6  nil = 0;
     7 
    58type
    6   Void = type;
    7   Ordinal = type(Void);
    8   Float = type(Void);
     9  TType = type;
     10  Void = type(TType);
     11  Ordinal = type(TType);
     12  Float = type(TType);
    913  Boolean = (False, True);
    1014 
     
    3034 
    3135  String = array of Char;
    32   Pointer = ^Void;
    33   TObject = class
    34     function ClassName: string;
    35     constructor Create; internal;
    36     destructor Destroy; internal;
    37   end;
     36  Pointer = ^TType;
     37  TObject = class;
    3838
    39 const
    40   MemoryManagerSizeType: TType = Integer;
     39type
    4140 
    42 type
    43   TMemoryManager = record
    44     function Alloc(Size: Integer): Pointer;
    45     function Free(P: Pointer): Integer;
    46     function Realloc(P: Pointer; Size: Integer): Pointer;
    47   end;
    48   PMemoryManager = ^TMemoryManager;
    4941 
    5042  TSystem = record
    51     MemoryManager: TMemoryManager;
    5243  end;
    5344
     
    5546procedure Break; internal;
    5647procedure Continue; internal;
    57 procedure WriteLn; internal;
     48procedure WriteLn(Text: string); internal;
     49function SizeOf(Source: TType): Integer; internal;
     50function IntToStr(Value: Integer): string; internal;
    5851
    59 procedure Move(const Source: type; var Dest: type; Count: Integer);
    60 procedure FillChar(var Dest: type; Count: Integer; Value: Byte);
     52procedure Move(const Source: TType; var Dest: TType; Count: Integer); internal;
     53procedure FillChar(var Dest: TType; Count: Integer; Value: Byte); internal;
    6154 
    6255implementation
    63 
    64 uses
    65   MemoryManager;
    6656
    6757initialization
  • trunk/IDE/Forms/UCodeForm.lfm

    r2 r21  
    618618    )
    619619    BracketHighlightStyle = sbhsBoth
     620    OnChange = SynEditSourceChange
    620621    inline SynGutterPartList1: TSynGutterPartList
    621622      object SynGutterMarks1: TSynGutterMarks
     
    725726      end
    726727    end
    727     inline SynRightGutterPartList1: TSynRightGutterPartList
    728     end
    729728  end
    730729  object CoolDockClient1: TCoolDockClient
     
    735734  end
    736735  object SynPasSyn1: TSynPasSyn
     736    Enabled = False
     737    AsmAttri.FrameEdges = sfeAround
     738    CommentAttri.FrameEdges = sfeAround
     739    IdentifierAttri.FrameEdges = sfeAround
     740    KeyAttri.FrameEdges = sfeAround
     741    NumberAttri.FrameEdges = sfeAround
     742    SpaceAttri.FrameEdges = sfeAround
     743    StringAttri.FrameEdges = sfeAround
     744    SymbolAttri.FrameEdges = sfeAround
     745    CaseLabelAttri.FrameEdges = sfeAround
     746    DirectiveAttri.FrameEdges = sfeAround
    737747    CompilerMode = pcmDelphi
    738748    NestedComments = False
  • trunk/IDE/Forms/UCodeForm.pas

    r2 r21  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, UCoolDocking,
    9   SynEdit, SynHighlighterPas;
     9  SynEdit, SynHighlighterPas, UProject;
    1010
    1111type
     
    1717    SynEditSource: TSynEdit;
    1818    SynPasSyn1: TSynPasSyn;
     19    procedure SynEditSourceChange(Sender: TObject);
    1920  private
    2021    { private declarations }
    2122  public
    22     { public declarations }
     23    ProjectFile: TProjectFile;
    2324  end;
    2425
     
    2829implementation
    2930
     31uses
     32  UMainForm;
     33
    3034{$R *.lfm}
     35
     36{ TCodeForm }
     37
     38procedure TCodeForm.SynEditSourceChange(Sender: TObject);
     39begin
     40  ProjectFile.Modified := True;
     41end;
    3142
    3243end.
  • trunk/IDE/Forms/UMainForm.lfm

    r12 r21  
    163163      Caption = 'Save'
    164164      Hint = 'Save project to disk'
     165      OnExecute = AProjectSaveExecute
    165166    end
    166167    object AProjectSaveAs: TAction
  • trunk/IDE/Forms/UMainForm.pas

    r20 r21  
    5454    procedure AProjectOpenExecute(Sender: TObject);
    5555    procedure AProjectSaveAsExecute(Sender: TObject);
     56    procedure AProjectSaveExecute(Sender: TObject);
    5657    procedure ComboBox1Change(Sender: TObject);
    5758    procedure ComboBoxProducerChange(Sender: TObject);
     
    292293  if SaveDialog1.Execute then begin
    293294    Project.SaveToFile(SaveDialog1.FileName);
    294   end;
     295    Project.Save;
     296  end;
     297end;
     298
     299procedure TMainForm.AProjectSaveExecute(Sender: TObject);
     300begin
     301  Project.Save;
    295302end;
    296303
  • trunk/IDE/Transpascal.lpi

    r20 r21  
    7171        <ResourceBaseClass Value="Form"/>
    7272        <UnitName Value="UMainForm"/>
    73         <IsVisibleTab Value="True"/>
    7473        <EditorIndex Value="0"/>
    7574        <WindowIndex Value="0"/>
    76         <TopLine Value="114"/>
    77         <CursorPos X="48" Y="114"/>
     75        <TopLine Value="133"/>
     76        <CursorPos X="14" Y="138"/>
    7877        <UsageCount Value="215"/>
    7978        <Loaded Value="True"/>
     
    9796        <TopLine Value="745"/>
    9897        <CursorPos X="46" Y="759"/>
    99         <UsageCount Value="118"/>
     98        <UsageCount Value="117"/>
    10099        <DefaultSyntaxHighlighter Value="Delphi"/>
    101100      </Unit3>
     
    106105        <TopLine Value="1"/>
    107106        <CursorPos X="40" Y="11"/>
    108         <UsageCount Value="118"/>
     107        <UsageCount Value="117"/>
    109108        <DefaultSyntaxHighlighter Value="Delphi"/>
    110109      </Unit4>
     
    115114        <TopLine Value="187"/>
    116115        <CursorPos X="34" Y="201"/>
    117         <UsageCount Value="118"/>
     116        <UsageCount Value="117"/>
    118117      </Unit5>
    119118      <Unit6>
     
    123122        <TopLine Value="1"/>
    124123        <CursorPos X="1" Y="14"/>
    125         <UsageCount Value="118"/>
     124        <UsageCount Value="117"/>
    126125      </Unit6>
    127126      <Unit7>
     
    131130        <TopLine Value="124"/>
    132131        <CursorPos X="42" Y="136"/>
    133         <UsageCount Value="118"/>
     132        <UsageCount Value="117"/>
    134133      </Unit7>
    135134      <Unit8>
     
    139138        <TopLine Value="442"/>
    140139        <CursorPos X="47" Y="455"/>
    141         <UsageCount Value="118"/>
     140        <UsageCount Value="117"/>
    142141      </Unit8>
    143142      <Unit9>
     
    147146        <TopLine Value="78"/>
    148147        <CursorPos X="27" Y="86"/>
    149         <UsageCount Value="10"/>
     148        <UsageCount Value="9"/>
    150149      </Unit9>
    151150      <Unit10>
     
    154153        <TopLine Value="61"/>
    155154        <CursorPos X="7" Y="68"/>
    156         <UsageCount Value="20"/>
     155        <UsageCount Value="19"/>
    157156      </Unit10>
    158157      <Unit11>
     
    161160        <TopLine Value="139"/>
    162161        <CursorPos X="16" Y="146"/>
    163         <UsageCount Value="20"/>
     162        <UsageCount Value="19"/>
    164163      </Unit11>
    165164      <Unit12>
     
    169168        <TopLine Value="69"/>
    170169        <CursorPos X="1" Y="82"/>
    171         <UsageCount Value="80"/>
     170        <UsageCount Value="79"/>
    172171      </Unit12>
    173172      <Unit13>
     
    177176        <TopLine Value="320"/>
    178177        <CursorPos X="1" Y="327"/>
    179         <UsageCount Value="34"/>
     178        <UsageCount Value="33"/>
    180179      </Unit13>
    181180      <Unit14>
     
    183182        <IsPartOfProject Value="True"/>
    184183        <UnitName Value="UProject"/>
     184        <IsVisibleTab Value="True"/>
    185185        <EditorIndex Value="1"/>
    186186        <WindowIndex Value="0"/>
    187         <TopLine Value="262"/>
    188         <CursorPos X="1" Y="269"/>
     187        <TopLine Value="259"/>
     188        <CursorPos X="3" Y="266"/>
    189189        <UsageCount Value="223"/>
    190190        <Loaded Value="True"/>
     
    197197        <TopLine Value="70"/>
    198198        <CursorPos X="53" Y="92"/>
    199         <UsageCount Value="98"/>
     199        <UsageCount Value="97"/>
    200200      </Unit15>
    201201      <Unit16>
     
    205205        <TopLine Value="3"/>
    206206        <CursorPos X="32" Y="17"/>
    207         <UsageCount Value="99"/>
     207        <UsageCount Value="98"/>
    208208      </Unit16>
    209209      <Unit17>
     
    213213        <TopLine Value="45"/>
    214214        <CursorPos X="14" Y="58"/>
    215         <UsageCount Value="98"/>
     215        <UsageCount Value="97"/>
    216216      </Unit17>
    217217      <Unit18>
     
    221221        <ResourceBaseClass Value="Form"/>
    222222        <UnitName Value="UProjectManager"/>
    223         <WindowIndex Value="0"/>
    224         <TopLine Value="44"/>
    225         <CursorPos X="39" Y="57"/>
     223        <EditorIndex Value="10"/>
     224        <WindowIndex Value="0"/>
     225        <TopLine Value="1"/>
     226        <CursorPos X="37" Y="52"/>
    226227        <UsageCount Value="207"/>
     228        <Loaded Value="True"/>
    227229        <DefaultSyntaxHighlighter Value="Delphi"/>
    228230      </Unit18>
     
    233235        <ResourceBaseClass Value="Form"/>
    234236        <UnitName Value="UCodeForm"/>
    235         <WindowIndex Value="0"/>
    236         <TopLine Value="1"/>
    237         <CursorPos X="26" Y="17"/>
     237        <EditorIndex Value="2"/>
     238        <WindowIndex Value="0"/>
     239        <TopLine Value="1"/>
     240        <CursorPos X="36" Y="9"/>
    238241        <UsageCount Value="207"/>
     242        <Loaded Value="True"/>
     243        <LoadedDesigner Value="True"/>
    239244        <DefaultSyntaxHighlighter Value="Delphi"/>
    240245      </Unit19>
     
    282287        <TopLine Value="141"/>
    283288        <CursorPos X="93" Y="154"/>
    284         <UsageCount Value="76"/>
     289        <UsageCount Value="75"/>
    285290      </Unit23>
    286291      <Unit24>
     
    320325        <TopLine Value="268"/>
    321326        <CursorPos X="39" Y="283"/>
    322         <UsageCount Value="109"/>
     327        <UsageCount Value="108"/>
    323328      </Unit27>
    324329      <Unit28>
     
    328333        <TopLine Value="143"/>
    329334        <CursorPos X="68" Y="156"/>
    330         <UsageCount Value="73"/>
     335        <UsageCount Value="72"/>
    331336      </Unit28>
    332337      <Unit29>
     
    336341        <TopLine Value="309"/>
    337342        <CursorPos X="64" Y="322"/>
    338         <UsageCount Value="106"/>
     343        <UsageCount Value="105"/>
    339344      </Unit29>
    340345      <Unit30>
     
    344349        <TopLine Value="266"/>
    345350        <CursorPos X="32" Y="279"/>
    346         <UsageCount Value="106"/>
     351        <UsageCount Value="105"/>
    347352      </Unit30>
    348353      <Unit31>
     
    352357        <TopLine Value="15"/>
    353358        <CursorPos X="1" Y="28"/>
    354         <UsageCount Value="23"/>
     359        <UsageCount Value="22"/>
    355360      </Unit31>
    356361      <Unit32>
     
    369374        <TopLine Value="365"/>
    370375        <CursorPos X="5" Y="370"/>
    371         <UsageCount Value="3"/>
     376        <UsageCount Value="2"/>
    372377      </Unit33>
    373378      <Unit34>
     
    377382        <TopLine Value="26"/>
    378383        <CursorPos X="14" Y="39"/>
    379         <UsageCount Value="103"/>
     384        <UsageCount Value="102"/>
    380385      </Unit34>
    381386      <Unit35>
     
    394399        <TopLine Value="1"/>
    395400        <CursorPos X="36" Y="55"/>
    396         <UsageCount Value="16"/>
     401        <UsageCount Value="15"/>
    397402        <DefaultSyntaxHighlighter Value="Delphi"/>
    398403      </Unit36>
     
    402407        <TopLine Value="1"/>
    403408        <CursorPos X="3" Y="21"/>
    404         <UsageCount Value="16"/>
     409        <UsageCount Value="15"/>
    405410        <DefaultSyntaxHighlighter Value="Delphi"/>
    406411      </Unit37>
     
    410415        <TopLine Value="1377"/>
    411416        <CursorPos X="32" Y="1396"/>
    412         <UsageCount Value="16"/>
     417        <UsageCount Value="15"/>
    413418        <DefaultSyntaxHighlighter Value="Delphi"/>
    414419      </Unit38>
     
    418423        <TopLine Value="27"/>
    419424        <CursorPos X="84" Y="48"/>
    420         <UsageCount Value="10"/>
     425        <UsageCount Value="9"/>
    421426      </Unit39>
    422427      <Unit40>
     
    425430        <TopLine Value="100"/>
    426431        <CursorPos X="43" Y="102"/>
    427         <UsageCount Value="10"/>
     432        <UsageCount Value="9"/>
    428433      </Unit40>
    429434      <Unit41>
     
    433438        <TopLine Value="1"/>
    434439        <CursorPos X="44" Y="6"/>
    435         <UsageCount Value="14"/>
     440        <UsageCount Value="13"/>
    436441      </Unit41>
    437442      <Unit42>
     
    441446        <TopLine Value="22"/>
    442447        <CursorPos X="2" Y="35"/>
    443         <UsageCount Value="14"/>
     448        <UsageCount Value="13"/>
    444449      </Unit42>
    445450      <Unit43>
    446451        <Filename Value="E:\Projekty\PascalClassLibrary\Generics\TemplateGenerics\Generic\GenericList.inc"/>
    447         <WindowIndex Value="0"/>
    448         <TopLine Value="71"/>
    449         <CursorPos X="1" Y="84"/>
    450         <UsageCount Value="77"/>
     452        <EditorIndex Value="11"/>
     453        <WindowIndex Value="0"/>
     454        <TopLine Value="12"/>
     455        <CursorPos X="14" Y="25"/>
     456        <UsageCount Value="78"/>
     457        <Loaded Value="True"/>
    451458      </Unit43>
    452459      <Unit44>
     
    455462        <TopLine Value="107"/>
    456463        <CursorPos X="10" Y="120"/>
    457         <UsageCount Value="74"/>
     464        <UsageCount Value="73"/>
    458465      </Unit44>
    459466      <Unit45>
     
    463470        <TopLine Value="1"/>
    464471        <CursorPos X="1" Y="12"/>
    465         <UsageCount Value="73"/>
     472        <UsageCount Value="72"/>
    466473      </Unit45>
    467474      <Unit46>
    468475        <Filename Value="..\Compiler\UCompiler.pas"/>
    469476        <UnitName Value="UCompiler"/>
    470         <EditorIndex Value="2"/>
     477        <EditorIndex Value="3"/>
    471478        <WindowIndex Value="0"/>
    472479        <TopLine Value="60"/>
    473         <CursorPos X="1" Y="76"/>
    474         <UsageCount Value="35"/>
     480        <CursorPos X="45" Y="68"/>
     481        <UsageCount Value="37"/>
    475482        <Loaded Value="True"/>
    476483      </Unit46>
     
    481488        <TopLine Value="58"/>
    482489        <CursorPos X="1" Y="79"/>
    483         <UsageCount Value="32"/>
     490        <UsageCount Value="31"/>
    484491      </Unit47>
    485492      <Unit48>
    486493        <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    487494        <UnitName Value="UAnalyzer"/>
    488         <EditorIndex Value="3"/>
     495        <EditorIndex Value="4"/>
    489496        <WindowIndex Value="0"/>
    490497        <TopLine Value="66"/>
    491498        <CursorPos X="37" Y="79"/>
    492         <UsageCount Value="34"/>
     499        <UsageCount Value="36"/>
    493500        <Loaded Value="True"/>
    494501      </Unit48>
     
    496503        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    497504        <UnitName Value="UAnalyzerPascal"/>
    498         <EditorIndex Value="8"/>
    499         <WindowIndex Value="0"/>
    500         <TopLine Value="95"/>
    501         <CursorPos X="1" Y="108"/>
    502         <UsageCount Value="34"/>
     505        <EditorIndex Value="9"/>
     506        <WindowIndex Value="0"/>
     507        <TopLine Value="709"/>
     508        <CursorPos X="36" Y="719"/>
     509        <UsageCount Value="36"/>
    503510        <Loaded Value="True"/>
    504511      </Unit49>
     
    506513        <Filename Value="..\Compiler\Produce\UProducerPascal.pas"/>
    507514        <UnitName Value="UProducerPascal"/>
    508         <EditorIndex Value="6"/>
    509         <WindowIndex Value="0"/>
    510         <TopLine Value="267"/>
    511         <CursorPos X="14" Y="270"/>
    512         <UsageCount Value="34"/>
     515        <EditorIndex Value="7"/>
     516        <WindowIndex Value="0"/>
     517        <TopLine Value="148"/>
     518        <CursorPos X="52" Y="171"/>
     519        <UsageCount Value="36"/>
    513520        <Loaded Value="True"/>
    514521      </Unit50>
     
    519526        <TopLine Value="10"/>
    520527        <CursorPos X="40" Y="23"/>
    521         <UsageCount Value="31"/>
     528        <UsageCount Value="30"/>
    522529      </Unit51>
    523530      <Unit52>
     
    527534        <TopLine Value="107"/>
    528535        <CursorPos X="22" Y="110"/>
    529         <UsageCount Value="6"/>
     536        <UsageCount Value="5"/>
    530537      </Unit52>
    531538      <Unit53>
     
    535542        <TopLine Value="16"/>
    536543        <CursorPos X="33" Y="26"/>
    537         <UsageCount Value="13"/>
     544        <UsageCount Value="12"/>
    538545      </Unit53>
    539546      <Unit54>
    540547        <Filename Value="..\Compiler\USourceCode.pas"/>
    541548        <UnitName Value="USourceCode"/>
    542         <EditorIndex Value="7"/>
    543         <WindowIndex Value="0"/>
    544         <TopLine Value="707"/>
    545         <CursorPos X="3" Y="711"/>
    546         <UsageCount Value="34"/>
     549        <EditorIndex Value="8"/>
     550        <WindowIndex Value="0"/>
     551        <TopLine Value="588"/>
     552        <CursorPos X="9" Y="590"/>
     553        <UsageCount Value="36"/>
    547554        <Loaded Value="True"/>
    548555      </Unit54>
     
    553560        <TopLine Value="1"/>
    554561        <CursorPos X="55" Y="19"/>
    555         <UsageCount Value="6"/>
     562        <UsageCount Value="5"/>
    556563      </Unit55>
    557564      <Unit56>
     
    561568        <TopLine Value="1"/>
    562569        <CursorPos X="26" Y="5"/>
    563         <UsageCount Value="6"/>
     570        <UsageCount Value="5"/>
    564571      </Unit56>
    565572      <Unit57>
     
    569576        <TopLine Value="1"/>
    570577        <CursorPos X="37" Y="12"/>
    571         <UsageCount Value="32"/>
     578        <UsageCount Value="31"/>
    572579      </Unit57>
    573580      <Unit58>
     
    577584        <TopLine Value="12"/>
    578585        <CursorPos X="38" Y="26"/>
    579         <UsageCount Value="32"/>
     586        <UsageCount Value="31"/>
    580587      </Unit58>
    581588      <Unit59>
     
    585592        <TopLine Value="438"/>
    586593        <CursorPos X="3" Y="406"/>
    587         <UsageCount Value="6"/>
     594        <UsageCount Value="5"/>
    588595      </Unit59>
    589596      <Unit60>
     
    592599        <TopLine Value="628"/>
    593600        <CursorPos X="1" Y="649"/>
    594         <UsageCount Value="32"/>
     601        <UsageCount Value="31"/>
    595602      </Unit60>
    596603      <Unit61>
     
    599606        <TopLine Value="1"/>
    600607        <CursorPos X="24" Y="4"/>
    601         <UsageCount Value="13"/>
     608        <UsageCount Value="12"/>
    602609      </Unit61>
    603610      <Unit62>
     
    607614        <TopLine Value="1"/>
    608615        <CursorPos X="1" Y="1"/>
    609         <UsageCount Value="12"/>
     616        <UsageCount Value="11"/>
    610617      </Unit62>
    611618      <Unit63>
    612619        <Filename Value="E:\Programy\Lazarus\fpc\2.4.3\source\rtl\objpas\classes\classesh.inc"/>
    613         <EditorIndex Value="4"/>
     620        <EditorIndex Value="5"/>
    614621        <WindowIndex Value="0"/>
    615622        <TopLine Value="625"/>
    616623        <CursorPos X="36" Y="638"/>
    617         <UsageCount Value="11"/>
     624        <UsageCount Value="13"/>
    618625        <Loaded Value="True"/>
    619626      </Unit63>
    620627      <Unit64>
    621628        <Filename Value="E:\Programy\Lazarus\fpc\2.4.3\source\rtl\objpas\classes\stringl.inc"/>
    622         <EditorIndex Value="5"/>
     629        <EditorIndex Value="6"/>
    623630        <WindowIndex Value="0"/>
    624631        <TopLine Value="428"/>
    625632        <CursorPos X="3" Y="441"/>
    626         <UsageCount Value="11"/>
     633        <UsageCount Value="13"/>
    627634        <Loaded Value="True"/>
    628635      </Unit64>
    629636    </Units>
    630     <JumpHistory Count="29" HistoryIndex="28">
     637    <JumpHistory Count="30" HistoryIndex="29">
    631638      <Position1>
    632         <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    633         <Caret Line="537" Column="1" TopLine="519"/>
     639        <Filename Value="..\Compiler\USourceCode.pas"/>
     640        <Caret Line="740" Column="1" TopLine="727"/>
    634641      </Position1>
    635642      <Position2>
    636643        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    637         <Caret Line="546" Column="1" TopLine="536"/>
     644        <Caret Line="385" Column="1" TopLine="372"/>
    638645      </Position2>
    639646      <Position3>
    640647        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    641         <Caret Line="550" Column="47" TopLine="540"/>
     648        <Caret Line="617" Column="1" TopLine="604"/>
    642649      </Position3>
    643650      <Position4>
    644651        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    645         <Caret Line="442" Column="27" TopLine="434"/>
     652        <Caret Line="385" Column="1" TopLine="372"/>
    646653      </Position4>
    647654      <Position5>
    648655        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    649         <Caret Line="488" Column="21" TopLine="481"/>
     656        <Caret Line="617" Column="1" TopLine="604"/>
    650657      </Position5>
    651658      <Position6>
    652659        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    653         <Caret Line="562" Column="4" TopLine="548"/>
     660        <Caret Line="385" Column="1" TopLine="372"/>
    654661      </Position6>
    655662      <Position7>
    656         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    657         <Caret Line="260" Column="26" TopLine="243"/>
     663        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     664        <Caret Line="843" Column="51" TopLine="836"/>
    658665      </Position7>
    659666      <Position8>
    660         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    661         <Caret Line="257" Column="19" TopLine="243"/>
     667        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     668        <Caret Line="385" Column="1" TopLine="363"/>
    662669      </Position8>
    663670      <Position9>
    664         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    665         <Caret Line="53" Column="27" TopLine="40"/>
     671        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     672        <Caret Line="617" Column="30" TopLine="604"/>
    666673      </Position9>
    667674      <Position10>
    668         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    669         <Caret Line="227" Column="51" TopLine="214"/>
     675        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     676        <Caret Line="532" Column="28" TopLine="516"/>
    670677      </Position10>
    671678      <Position11>
    672         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    673         <Caret Line="257" Column="3" TopLine="244"/>
     679        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     680        <Caret Line="722" Column="48" TopLine="703"/>
    674681      </Position11>
    675682      <Position12>
    676         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    677         <Caret Line="259" Column="48" TopLine="246"/>
     683        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     684        <Caret Line="725" Column="61" TopLine="703"/>
    678685      </Position12>
    679686      <Position13>
    680         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    681         <Caret Line="254" Column="3" TopLine="243"/>
     687        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     688        <Caret Line="385" Column="1" TopLine="372"/>
    682689      </Position13>
    683690      <Position14>
    684         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    685         <Caret Line="53" Column="5" TopLine="30"/>
     691        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     692        <Caret Line="617" Column="1" TopLine="604"/>
    686693      </Position14>
    687694      <Position15>
    688         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    689         <Caret Line="229" Column="47" TopLine="214"/>
     695        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     696        <Caret Line="722" Column="1" TopLine="709"/>
    690697      </Position15>
    691698      <Position16>
    692         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    693         <Caret Line="259" Column="48" TopLine="246"/>
     699        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     700        <Caret Line="725" Column="1" TopLine="709"/>
    694701      </Position16>
    695702      <Position17>
    696703        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    697         <Caret Line="562" Column="4" TopLine="548"/>
     704        <Caret Line="722" Column="1" TopLine="709"/>
    698705      </Position17>
    699706      <Position18>
    700707        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    701         <Caret Line="99" Column="17" TopLine="91"/>
     708        <Caret Line="515" Column="1" TopLine="502"/>
    702709      </Position18>
    703710      <Position19>
    704         <Filename Value="..\Compiler\Analyze\UAnalyzer.pas"/>
    705         <Caret Line="79" Column="30" TopLine="66"/>
     711        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     712        <Caret Line="516" Column="1" TopLine="502"/>
    706713      </Position19>
    707714      <Position20>
    708715        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    709         <Caret Line="99" Column="45" TopLine="86"/>
     716        <Caret Line="517" Column="1" TopLine="502"/>
    710717      </Position20>
    711718      <Position21>
    712719        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    713         <Caret Line="108" Column="1" TopLine="86"/>
     720        <Caret Line="518" Column="1" TopLine="535"/>
    714721      </Position21>
    715722      <Position22>
    716         <Filename Value="..\Compiler\UCompiler.pas"/>
    717         <Caret Line="79" Column="19" TopLine="63"/>
     723        <Filename Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
     724        <Caret Line="849" Column="1" TopLine="836"/>
    718725      </Position22>
    719726      <Position23>
    720         <Filename Value="..\Compiler\UCompiler.pas"/>
    721         <Caret Line="73" Column="1" TopLine="60"/>
     727        <Filename Value="Forms\UCodeForm.pas"/>
     728        <Caret Line="17" Column="26" TopLine="1"/>
    722729      </Position23>
    723730      <Position24>
    724         <Filename Value="..\Compiler\UCompiler.pas"/>
    725         <Caret Line="74" Column="1" TopLine="60"/>
     731        <Filename Value="Forms\UCodeForm.pas"/>
     732        <Caret Line="40" Column="16" TopLine="16"/>
    726733      </Position24>
    727734      <Position25>
    728         <Filename Value="..\Compiler\UCompiler.pas"/>
    729         <Caret Line="76" Column="1" TopLine="60"/>
     735        <Filename Value="Forms\UCodeForm.pas"/>
     736        <Caret Line="9" Column="36" TopLine="1"/>
    730737      </Position25>
    731738      <Position26>
    732739        <Filename Value="Forms\UMainForm.pas"/>
    733         <Caret Line="114" Column="54" TopLine="107"/>
     740        <Caret Line="74" Column="5" TopLine="61"/>
    734741      </Position26>
    735742      <Position27>
    736743        <Filename Value="Forms\UMainForm.pas"/>
    737         <Caret Line="125" Column="3" TopLine="114"/>
     744        <Caret Line="300" Column="12" TopLine="283"/>
    738745      </Position27>
    739746      <Position28>
    740747        <Filename Value="Forms\UMainForm.pas"/>
    741         <Caret Line="97" Column="41" TopLine="84"/>
     748        <Caret Line="294" Column="21" TopLine="283"/>
    742749      </Position28>
    743750      <Position29>
    744         <Filename Value="Forms\UMainForm.pas"/>
    745         <Caret Line="75" Column="42" TopLine="62"/>
     751        <Filename Value="UProject.pas"/>
     752        <Caret Line="42" Column="1" TopLine="93"/>
    746753      </Position29>
     754      <Position30>
     755        <Filename Value="UProject.pas"/>
     756        <Caret Line="268" Column="17" TopLine="248"/>
     757      </Position30>
    747758    </JumpHistory>
    748759  </ProjectOptions>
     
    786797  </CompilerOptions>
    787798  <Debugging>
    788     <BreakPoints Count="4">
     799    <BreakPoints Count="1">
    789800      <Item1>
    790801        <Source Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    791         <Line Value="1204"/>
     802        <Line Value="849"/>
    792803      </Item1>
    793       <Item2>
    794         <Source Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    795         <Line Value="1229"/>
    796       </Item2>
    797       <Item3>
    798         <Source Value="..\Compiler\Analyze\UAnalyzerPascal.pas"/>
    799         <Line Value="1039"/>
    800       </Item3>
    801       <Item4>
    802         <Source Value="..\Compiler\UCompiler.pas"/>
    803         <Line Value="73"/>
    804       </Item4>
    805804    </BreakPoints>
    806805    <Exceptions Count="3">
  • trunk/IDE/UProject.pas

    r10 r21  
    1717    Name: string;
    1818    ProducedFileName: string;
     19    Modified: Boolean;
    1920    procedure SaveToXMLNode(Node: TDOMNode); virtual;
    2021    procedure LoadFromXMLNode(Node: TDOMNode); virtual;
     
    120121
    121122procedure TProjectGroup.SaveToXMLNode(Node: TDOMNode);
     123var
     124  I: Integer;
     125  NewNode: TDOMNode;
    122126begin
    123127  inherited SaveToXMLNode(Node);
     128  with Node do begin
     129    NewNode := OwnerDocument.CreateElement('File');
     130    TDOMElement(NewNode).SetAttribute('Name', UTF8Decode(Name));
     131    TDOMElement(NewNode).SetAttribute('Type', 'File');
     132    AppendChild(NewNode);
     133  end;
     134  for I := 0 to Items.Count - 1 do begin
     135    TProjectNode(Items[I]).SaveToXMLNode(NewNode);
     136  end
    124137end;
    125138
     
    160173begin
    161174  inherited SaveToXMLNode(Node);
     175  Save;
    162176end;
    163177
     
    199213procedure TProjectNode.Save;
    200214begin
    201 
     215  Modified := False;
    202216end;
    203217
     
    260274
    261275procedure TProject.SaveToFile(FileName: string);
    262 begin
    263 
     276var
     277  Doc: TXMLDocument;
     278  RootNode: TDOMNode;
     279  NewNode: TDOMNode;
     280  NewSubNode: TDOMNode;
     281  I: Integer;
     282  Text: string;
     283begin
     284  Doc := TXMLDocument.Create;
     285  with Doc do try
     286    RootNode := CreateElement('Project');
     287    AppendChild(RootNode);
     288    with RootNode do begin
     289      NewNode := OwnerDocument.CreateElement('Files');
     290      SaveToXMLNode(NewNode);
     291    end;
     292    WriteXMLFile(Doc, UTF8Decode(FileName));
     293  finally
     294    Free;
     295  end;
     296  inherited Save;
    264297end;
    265298
Note: See TracChangeset for help on using the changeset viewer.