Changeset 39 for branches/DelphiToC/UPascalSource.pas
- Timestamp:
- Aug 5, 2010, 9:51:16 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/UPascalSource.pas
r38 r39 7 7 uses 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 Dialogs, StdCtrls,Contnrs;9 Dialogs, Contnrs; 10 10 11 11 type … … 200 200 end; 201 201 202 { TExpression } 203 202 204 TExpression = class 203 205 CommonBlock: TCommonBlock; … … 211 213 constructor Create; 212 214 destructor Destroy; override; 215 procedure Assign(Source: TExpression); 213 216 end; 214 217 … … 310 313 311 314 destructor TConstantList.Destroy; 312 var 313 I: Integer; 314 begin 315 for I := 0 to Count - 1 do 316 TConstant(Items[I]).Free; 315 begin 317 316 inherited; 318 317 end; … … 394 393 395 394 destructor TTypeList.Destroy; 396 var 397 I: Integer; 398 begin 399 for I := 0 to Count - 1 do 400 TType(Items[I]).Free; 395 begin 401 396 inherited; 402 397 end; … … 430 425 while (I < Count) and (TVariable(Items[I]).Name <> Name) do Inc(I); 431 426 if I < Count then Result := TVariable(Items[I]) else begin 432 if Assigned(Parent.Parent) then Result := Parent.Parent.Variables.Search(Name) 433 else begin 434 Result := nil; 435 end; 427 if Assigned(Parent.Parent) then 428 Result := Parent.Parent.Variables.Search(Name) 429 else Result := nil; 436 430 end; 437 431 end; … … 473 467 SubItems := TExpressionList.Create; 474 468 SubItems.Count := 2; 469 SubItems.OwnsObjects := False; 475 470 end; 476 471 … … 479 474 SubItems.Free; 480 475 inherited; 476 end; 477 478 procedure TExpression.Assign(Source: TExpression); 479 begin 480 CommonBlock := Source.CommonBlock; 481 NodeType := Source.NodeType; 482 Method := Source.Method; 483 Value := Source.Value; 484 Associated := Source.Associated; 485 OperatorName := Source.OperatorName; 486 Variable := Source.Variable; 487 SubItems.Assign(Source.SubItems); 481 488 end; 482 489 … … 503 510 504 511 destructor TExpressionList.Destroy; 505 var 506 I: Integer; 507 begin 508 for I := 0 to Count - 1 do 509 TExpression(Items[I]).Free; 512 begin 510 513 inherited; 511 514 end; … … 514 517 515 518 destructor TParameterList.Destroy; 516 var 517 I: Integer; 518 begin 519 for I := 0 to Count - 1 do 520 TParameter(Items[I]).Free; 519 begin 521 520 inherited; 522 521 end;
Note:
See TracChangeset
for help on using the changeset viewer.