소스 검색

* Procedure body is now reachable (and assigned). (patch from [email protected])

git-svn-id: trunk@15981 -
michael 15 년 전
부모
커밋
84c28084ac
2개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      packages/fcl-passrc/src/pastree.pp
  2. 1 0
      packages/fcl-passrc/src/pparser.pp

+ 5 - 0
packages/fcl-passrc/src/pastree.pp

@@ -595,6 +595,8 @@ type
   TProcedureModifiers = Set of TProcedureModifier;
   TProcedureModifiers = Set of TProcedureModifier;
   TProcedureMessageType = (pmtInteger,pmtString);
   TProcedureMessageType = (pmtInteger,pmtString);
                         
                         
+  TProcedureBody = class;
+
   TPasProcedure = class(TPasProcedureBase)
   TPasProcedure = class(TPasProcedureBase)
   Private
   Private
     FCallingConvention : TCallingConvention;
     FCallingConvention : TCallingConvention;
@@ -609,6 +611,7 @@ type
     procedure GetModifiers(List: TStrings);
     procedure GetModifiers(List: TStrings);
   public
   public
     ProcType : TPasProcedureType;
     ProcType : TPasProcedureType;
+    Body : TProcedureBody;
     Procedure AddModifier(AModifier : TProcedureModifier);
     Procedure AddModifier(AModifier : TProcedureModifier);
     Function IsVirtual : Boolean;
     Function IsVirtual : Boolean;
     Function IsDynamic : Boolean;
     Function IsDynamic : Boolean;
@@ -1487,6 +1490,8 @@ destructor TPasProcedure.Destroy;
 begin
 begin
   if Assigned(ProcType) then
   if Assigned(ProcType) then
     ProcType.Release;
     ProcType.Release;
+  if Assigned(Body) then
+    Body.Release;
   inherited Destroy;
   inherited Destroy;
 end;
 end;
 
 

+ 1 - 0
packages/fcl-passrc/src/pparser.pp

@@ -2434,6 +2434,7 @@ var
   Body: TProcedureBody;
   Body: TProcedureBody;
 begin
 begin
   Body := TProcedureBody(CreateElement(TProcedureBody, '', Parent));
   Body := TProcedureBody(CreateElement(TProcedureBody, '', Parent));
+  TPasProcedure(Parent).Body:=Body;
   ParseDeclarations(Body);
   ParseDeclarations(Body);
 end;
 end;