|
@@ -857,6 +857,7 @@ type
|
|
|
procedure WriteClassType(Obj: TJSONObject; El: TPasClassType; aContext: TPCUWriterContext); virtual;
|
|
|
procedure WriteArgument(Obj: TJSONObject; El: TPasArgument; aContext: TPCUWriterContext); virtual;
|
|
|
procedure WriteProcTypeModifiers(Obj: TJSONObject; const PropName: string; const Value, DefaultValue: TProcTypeModifiers); virtual;
|
|
|
+ procedure WriteProcTypeScope(Obj: TJSONObject; Scope: TPas2JSProcTypeScope; aContext: TPCUWriterContext); virtual;
|
|
|
procedure WriteProcedureType(Obj: TJSONObject; El: TPasProcedureType; aContext: TPCUWriterContext); virtual;
|
|
|
procedure WriteResultElement(Obj: TJSONObject; El: TPasResultElement; aContext: TPCUWriterContext); virtual;
|
|
|
procedure WriteFunctionType(Obj: TJSONObject; El: TPasFunctionType; aContext: TPCUWriterContext); virtual;
|
|
@@ -1172,6 +1173,7 @@ type
|
|
|
procedure ReadArgument(Obj: TJSONObject; El: TPasArgument; aContext: TPCUReaderContext); virtual;
|
|
|
function ReadProcTypeModifiers(Obj: TJSONObject; El: TPasElement;
|
|
|
const PropName: string; const DefaultValue: TProcTypeModifiers): TProcTypeModifiers; virtual;
|
|
|
+ procedure ReadProcTypeScope(Obj: TJSONObject; Scope: TPas2JSProcTypeScope; aContext: TPCUReaderContext); virtual;
|
|
|
procedure ReadProcedureType(Obj: TJSONObject; El: TPasProcedureType; aContext: TPCUReaderContext); virtual;
|
|
|
procedure ReadResultElement(Obj: TJSONObject; El: TPasResultElement; aContext: TPCUReaderContext); virtual;
|
|
|
procedure ReadFunctionType(Obj: TJSONObject; El: TPasFunctionType; aContext: TPCUReaderContext); virtual;
|
|
@@ -4334,6 +4336,12 @@ begin
|
|
|
AddArrayFlag(Obj,Arr,PropName,PCUProcTypeModifierNames[f],f in Value);
|
|
|
end;
|
|
|
|
|
|
+procedure TPCUWriter.WriteProcTypeScope(Obj: TJSONObject;
|
|
|
+ Scope: TPas2JSProcTypeScope; aContext: TPCUWriterContext);
|
|
|
+begin
|
|
|
+ WriteIdentifierScope(Obj,Scope,aContext);
|
|
|
+end;
|
|
|
+
|
|
|
procedure TPCUWriter.WriteProcedureType(Obj: TJSONObject;
|
|
|
El: TPasProcedureType; aContext: TPCUWriterContext);
|
|
|
begin
|
|
@@ -4343,6 +4351,8 @@ begin
|
|
|
if El.CallingConvention<>ccDefault then
|
|
|
Obj.Add('Call',PCUCallingConventionNames[El.CallingConvention]);
|
|
|
WriteProcTypeModifiers(Obj,'Modifiers',El.Modifiers,GetDefaultProcTypeModifiers(El));
|
|
|
+ if El.CustomData is TPas2JSProcTypeScope then
|
|
|
+ WriteProcTypeScope(Obj,TPas2JSProcTypeScope(El.CustomData),aContext);
|
|
|
end;
|
|
|
|
|
|
procedure TPCUWriter.WriteResultElement(Obj: TJSONObject;
|
|
@@ -8870,12 +8880,20 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
+procedure TPCUReader.ReadProcTypeScope(Obj: TJSONObject;
|
|
|
+ Scope: TPas2JSProcTypeScope; aContext: TPCUReaderContext);
|
|
|
+begin
|
|
|
+ ReadIdentifierScope(Obj,Scope,aContext);
|
|
|
+ Scope.GenericStep:=psgsImplementationParsed;
|
|
|
+end;
|
|
|
+
|
|
|
procedure TPCUReader.ReadProcedureType(Obj: TJSONObject; El: TPasProcedureType;
|
|
|
aContext: TPCUReaderContext);
|
|
|
var
|
|
|
s: string;
|
|
|
Found: Boolean;
|
|
|
c: TCallingConvention;
|
|
|
+ Scope: TPas2JSProcTypeScope;
|
|
|
begin
|
|
|
ReadPasElement(Obj,El,aContext);
|
|
|
ReadGenericTemplateTypes(Obj,El,El.GenericTemplateTypes,aContext);
|
|
@@ -8898,6 +8916,13 @@ begin
|
|
|
end;
|
|
|
El.Modifiers:=ReadProcTypeModifiers(Obj,El,'Modifiers',GetDefaultProcTypeModifiers(El));
|
|
|
|
|
|
+ if (El.GenericTemplateTypes<>nil) and (El.GenericTemplateTypes.Count>0) then
|
|
|
+ begin
|
|
|
+ Scope:=TPas2JSProcTypeScope(Resolver.CreateScope(El,TPas2JSProcTypeScope));
|
|
|
+ El.CustomData:=Scope;
|
|
|
+ ReadProcTypeScope(Obj,Scope,aContext);
|
|
|
+ end;
|
|
|
+
|
|
|
ReadSpecializations(Obj,El);
|
|
|
end;
|
|
|
|