mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-25 15:09:56 +02:00
pastojs: filer: fixed checking signature in interface used unit referenced by implementation and needing indirect implementation unit
git-svn-id: trunk@47682 -
(cherry picked from commit d1cfb15a2a
)
This commit is contained in:
parent
3ef2fe2321
commit
26c99a7ac4
@ -798,6 +798,7 @@ type
|
|||||||
procedure WriteIdentifierScope(Obj: TJSONObject; Scope: TPasIdentifierScope; aContext: TPCUWriterContext); virtual;
|
procedure WriteIdentifierScope(Obj: TJSONObject; Scope: TPasIdentifierScope; aContext: TPCUWriterContext); virtual;
|
||||||
procedure WriteModuleScopeFlags(Obj: TJSONObject; const Value, DefaultValue: TPasModuleScopeFlags); virtual;
|
procedure WriteModuleScopeFlags(Obj: TJSONObject; const Value, DefaultValue: TPasModuleScopeFlags); virtual;
|
||||||
procedure WriteModuleScope(Obj: TJSONObject; Scope: TPas2JSModuleScope; aContext: TPCUWriterContext); virtual;
|
procedure WriteModuleScope(Obj: TJSONObject; Scope: TPas2JSModuleScope; aContext: TPCUWriterContext); virtual;
|
||||||
|
procedure WriteModuleScopeLocalVars(Obj: TJSONObject; Scope: TPas2JSModuleScope); virtual;
|
||||||
// element utilities
|
// element utilities
|
||||||
procedure WriteSrcPos(Obj: TJSONObject; El: TPasElement; aContext: TPCUWriterContext); virtual;
|
procedure WriteSrcPos(Obj: TJSONObject; El: TPasElement; aContext: TPCUWriterContext); virtual;
|
||||||
procedure WritePasElement(Obj: TJSONObject; El: TPasElement; aContext: TPCUWriterContext); virtual;
|
procedure WritePasElement(Obj: TJSONObject; El: TPasElement; aContext: TPCUWriterContext); virtual;
|
||||||
@ -1005,7 +1006,6 @@ type
|
|||||||
FJSON: TJSONObject;
|
FJSON: TJSONObject;
|
||||||
FPendingIdentifierScopes: TObjectList; // list of TPCUReaderPendingIdentifierScope
|
FPendingIdentifierScopes: TObjectList; // list of TPCUReaderPendingIdentifierScope
|
||||||
FPendingForwardProcs: TFPList; // list of TPasElement waiting for implementation of methods
|
FPendingForwardProcs: TFPList; // list of TPasElement waiting for implementation of methods
|
||||||
FIntfSectionObj: TJSONObject;
|
|
||||||
procedure Set_Variable_VarType(RefEl: TPasElement; Data: TObject);
|
procedure Set_Variable_VarType(RefEl: TPasElement; Data: TObject);
|
||||||
procedure Set_AliasType_DestType(RefEl: TPasElement; Data: TObject);
|
procedure Set_AliasType_DestType(RefEl: TPasElement; Data: TObject);
|
||||||
procedure Set_PointerType_DestType(RefEl: TPasElement; Data: TObject);
|
procedure Set_PointerType_DestType(RefEl: TPasElement; Data: TObject);
|
||||||
@ -2687,6 +2687,8 @@ begin
|
|||||||
WImplBlock(aModule.FinalizationSection,'Final');
|
WImplBlock(aModule.FinalizationSection,'Final');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
WriteModuleScopeLocalVars(Obj,ModScope);
|
||||||
|
|
||||||
//writeln('TPCUWriter.WriteModule WriteExternalReferences of implementation ',Resolver.RootElement.Name,' aContext.Section=',GetObjName(aContext.Section));
|
//writeln('TPCUWriter.WriteModule WriteExternalReferences of implementation ',Resolver.RootElement.Name,' aContext.Section=',GetObjName(aContext.Section));
|
||||||
WriteExternalReferences(aContext);
|
WriteExternalReferences(aContext);
|
||||||
|
|
||||||
@ -2799,10 +2801,6 @@ procedure TPCUWriter.WriteModuleScope(Obj: TJSONObject;
|
|||||||
Scope: TPas2JSModuleScope; aContext: TPCUWriterContext);
|
Scope: TPas2JSModuleScope; aContext: TPCUWriterContext);
|
||||||
var
|
var
|
||||||
aModule: TPasModule;
|
aModule: TPasModule;
|
||||||
i: Integer;
|
|
||||||
SubObj: TJSONObject;
|
|
||||||
LocalVar: TPas2JSStoredLocalVar;
|
|
||||||
LocalVars: TPas2JSStoredLocalVarArray;
|
|
||||||
begin
|
begin
|
||||||
aModule:=Scope.Element as TPasModule;
|
aModule:=Scope.Element as TPasModule;
|
||||||
if Scope.FirstName<>FirstDottedIdentifier(aModule.Name) then
|
if Scope.FirstName<>FirstDottedIdentifier(aModule.Name) then
|
||||||
@ -2818,6 +2816,19 @@ begin
|
|||||||
AddReferenceToObj(Obj,'SystemTVarRec',Scope.SystemTVarRec);
|
AddReferenceToObj(Obj,'SystemTVarRec',Scope.SystemTVarRec);
|
||||||
AddReferenceToObj(Obj,'SystemVarRecs',Scope.SystemVarRecs);
|
AddReferenceToObj(Obj,'SystemVarRecs',Scope.SystemVarRecs);
|
||||||
|
|
||||||
|
// Scope.StoreJSLocalVars is written later, because some references need implementation units
|
||||||
|
|
||||||
|
WritePasScope(Obj,Scope,aContext);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPCUWriter.WriteModuleScopeLocalVars(Obj: TJSONObject;
|
||||||
|
Scope: TPas2JSModuleScope);
|
||||||
|
var
|
||||||
|
LocalVars: TPas2JSStoredLocalVarArray;
|
||||||
|
SubObj: TJSONObject;
|
||||||
|
i: Integer;
|
||||||
|
LocalVar: TPas2JSStoredLocalVar;
|
||||||
|
begin
|
||||||
// StoreJSLocalVars
|
// StoreJSLocalVars
|
||||||
LocalVars:=Scope.StoreJSLocalVars;
|
LocalVars:=Scope.StoreJSLocalVars;
|
||||||
if length(LocalVars)>0 then
|
if length(LocalVars)>0 then
|
||||||
@ -2834,8 +2845,6 @@ begin
|
|||||||
AddReferenceToObj(SubObj,LocalVar.Name,LocalVar.Element);
|
AddReferenceToObj(SubObj,LocalVar.Name,LocalVar.Element);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
WritePasScope(Obj,Scope,aContext);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPCUWriter.WriteSrcPos(Obj: TJSONObject; El: TPasElement;
|
procedure TPCUWriter.WriteSrcPos(Obj: TJSONObject; El: TPasElement;
|
||||||
@ -3480,7 +3489,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// indirectly used unit (refs to directly used units are created in WriteSection)
|
// indirectly used unit (refs to directly used units are created in WriteSection)
|
||||||
if aContext.IndirectUsesArr=nil then
|
if aContext.IndirectUsesArr=nil then
|
||||||
begin
|
begin
|
||||||
if aContext.SectionObj=nil then
|
if aContext.SectionObj=nil then
|
||||||
RaiseMsg(20180314154428,El);
|
RaiseMsg(20180314154428,El);
|
||||||
//writeln('TPCUWriter.WriteExternalReference ',Resolver.RootElement.Name,' Section=',GetObjName(aContext.Section),' IndirectUses=',El.Name);
|
//writeln('TPCUWriter.WriteExternalReference ',Resolver.RootElement.Name,' Section=',GetObjName(aContext.Section),' IndirectUses=',El.Name);
|
||||||
@ -7005,7 +7014,7 @@ begin
|
|||||||
RaiseMsg(20180313134142,Section,GetObjName(Section.PendingUsedIntf));
|
RaiseMsg(20180313134142,Section,GetObjName(Section.PendingUsedIntf));
|
||||||
if Arr.Count<>length(Section.UsesClause) then
|
if Arr.Count<>length(Section.UsesClause) then
|
||||||
RaiseMsg(20180313134338,IntToStr(Arr.Count)+'<>'+IntToStr(length(Section.UsesClause)));
|
RaiseMsg(20180313134338,IntToStr(Arr.Count)+'<>'+IntToStr(length(Section.UsesClause)));
|
||||||
for i:=0 to Arr.Count-1 do
|
for i:=0 to Arr.Count-1 do
|
||||||
begin
|
begin
|
||||||
Data:=Arr[i];
|
Data:=Arr[i];
|
||||||
if not (Data is TJSONObject) then
|
if not (Data is TJSONObject) then
|
||||||
@ -7022,15 +7031,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// read external refs from indirectly used units
|
// read external refs from indirectly used units
|
||||||
if Section.ClassType=TInterfaceSection then
|
ReadIndirectUsedUnits(Obj,Section,true);
|
||||||
FIntfSectionObj:=Obj
|
|
||||||
else if Section.ClassType=TImplementationSection then
|
|
||||||
begin
|
|
||||||
ReadIndirectUsedUnits(FIntfSectionObj,Section,true);
|
|
||||||
ReadIndirectUsedUnits(Obj,Section,true);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
ReadIndirectUsedUnits(Obj,Section,true);
|
|
||||||
|
|
||||||
Scope.UsesFinished:=true;
|
Scope.UsesFinished:=true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user