Browse Source

pastojs: fixed resolve pending scopes before pending units

git-svn-id: trunk@39158 -
Mattias Gaertner 7 years ago
parent
commit
6d5c1642cd
1 changed files with 11 additions and 7 deletions
  1. 11 7
      packages/pastojs/src/pas2jsfiler.pp

+ 11 - 7
packages/pastojs/src/pas2jsfiler.pp

@@ -5331,7 +5331,10 @@ begin
   ReadDeclarations(Obj,Section,aContext);
   ReadDeclarations(Obj,Section,aContext);
   Scope.Finished:=true;
   Scope.Finished:=true;
   if Section is TInterfaceSection then
   if Section is TInterfaceSection then
+    begin
+    ResolvePending;
     Resolver.NotifyPendingUsedInterfaces;
     Resolver.NotifyPendingUsedInterfaces;
+    end;
 end;
 end;
 
 
 procedure TPCUReader.ReadDeclarations(Obj: TJSONObject; Section: TPasSection;
 procedure TPCUReader.ReadDeclarations(Obj: TJSONObject; Section: TPasSection;
@@ -7374,6 +7377,7 @@ begin
     PendingIdentifierScope:=TPCUReaderPendingIdentifierScope(FPendingIdentifierScopes[i]);
     PendingIdentifierScope:=TPCUReaderPendingIdentifierScope(FPendingIdentifierScopes[i]);
     ReadIdentifierScopeArray(PendingIdentifierScope.Arr,PendingIdentifierScope.Scope);
     ReadIdentifierScopeArray(PendingIdentifierScope.Arr,PendingIdentifierScope.Scope);
     end;
     end;
+  FPendingIdentifierScopes.Clear;
 
 
   Node:=FElementRefs.FindLowest;
   Node:=FElementRefs.FindLowest;
   while Node<>nil do
   while Node<>nil do
@@ -7556,13 +7560,13 @@ var
   Data: TJSONData;
   Data: TJSONData;
   i: Integer;
   i: Integer;
 begin
 begin
-  {$IFDEF VerbosePCUFiler}
-  writeln('TPCUReader.ReadJSONHeader START ');
-  {$ENDIF}
   FResolver:=aResolver;
   FResolver:=aResolver;
   FParser:=Resolver.CurrentParser;
   FParser:=Resolver.CurrentParser;
   FScanner:=FParser.Scanner;
   FScanner:=FParser.Scanner;
   FJSON:=Obj;
   FJSON:=Obj;
+  {$IF defined(VerbosePCUFiler) or defined(VerboseUnitQueue)}
+  writeln('TPCUReader.ReadJSONHeader START ');
+  {$ENDIF}
 
 
   ReadHeaderMagic(Obj);
   ReadHeaderMagic(Obj);
   ReadHeaderVersion(Obj);
   ReadHeaderVersion(Obj);
@@ -7604,8 +7608,8 @@ var
   Obj, SubObj: TJSONObject;
   Obj, SubObj: TJSONObject;
   aContext: TPCUReaderContext;
   aContext: TPCUReaderContext;
 begin
 begin
-  {$IFDEF VerbosePCUFiler}
-  writeln('TPCUReader.ReadJSONContinue START');
+  {$IF defined(VerbosePCUFiler) or defined(VerboseUnitQueue)}
+  writeln('TPCUReader.ReadContinue START ',Resolver.RootElement.Name);
   {$ENDIF}
   {$ENDIF}
   Obj:=JSON;
   Obj:=JSON;
   if not ReadObject(Obj,'Module',SubObj,nil) then
   if not ReadObject(Obj,'Module',SubObj,nil) then
@@ -7616,8 +7620,8 @@ begin
   finally
   finally
     aContext.Free;
     aContext.Free;
   end;
   end;
-  {$IFDEF VerbosePCUFiler}
-  writeln('TPCUReader.ReadJSONContinue END');
+  {$IF defined(VerbosePCUFiler) or defined(VerboseUnitQueue)}
+  writeln('TPCUReader.ReadContinue END');
   {$ENDIF}
   {$ENDIF}
 end;
 end;