fcl-passrc: paswrite: allow to write procedure type

git-svn-id: trunk@37059 -
This commit is contained in:
maciej-izak 2017-08-25 12:01:36 +00:00
parent 2e37c05f23
commit 597cf52a3a

View File

@ -49,6 +49,7 @@ type
procedure WriteSection(ASection: TPasSection);
procedure WriteClass(AClass: TPasClassType);
procedure WriteVariable(AVar: TPasVariable);
procedure WriteProcType(AProc: TPasProcedureType);
procedure WriteProcDecl(AProc: TPasProcedure);
procedure WriteProcImpl(AProc: TPasProcedureImpl);
procedure WriteProperty(AProp: TPasProperty);
@ -159,6 +160,8 @@ begin
WriteClass(TPasClassType(AType))
else if AType.ClassType = TPasEnumType then
wrtln(TPasEnumType(AType).GetDeclaration(true) + ';')
else if AType is TPasProcedureType then
WriteProcType(TPasProcedureType(AType))
else
raise Exception.Create('Writing not implemented for ' +
AType.ElementTypeName + ' nodes');
@ -333,6 +336,14 @@ begin
wrtln(';');
end;
procedure TPasWriter.WriteProcType(AProc: TPasProcedureType);
begin
wrt(TPasProcedureType(AProc).GetDeclaration(true));
if TPasProcedureType(AProc).CallingConvention<>ccDefault then
wrt('; '+cCallingConventions[TPasProcedureType(AProc).CallingConvention]);
wrtln(';');
end;
procedure TPasWriter.WriteProcDecl(AProc: TPasProcedure);
var
i: Integer;