mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 17:19:19 +02:00
* Merging revisions r46280 from trunk:
------------------------------------------------------------------------ r46280 | michael | 2020-08-06 08:50:29 +0200 (Thu, 06 Aug 2020) | 1 line * Support writing resource strings ------------------------------------------------------------------------ git-svn-id: branches/fixes_3_2@46606 -
This commit is contained in:
parent
896cbd84e1
commit
d791d13e4d
@ -83,6 +83,7 @@ type
|
|||||||
constructor Create(AStream: TStream); virtual;
|
constructor Create(AStream: TStream); virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure AddForwardClasses(aSection: TPasSection); virtual;
|
procedure AddForwardClasses(aSection: TPasSection); virtual;
|
||||||
|
procedure WriteResourceString(aStr: TPasResString); virtual;
|
||||||
procedure WriteEnumType(AType: TPasEnumType); virtual;
|
procedure WriteEnumType(AType: TPasEnumType); virtual;
|
||||||
procedure WriteElement(AElement: TPasElement);virtual;
|
procedure WriteElement(AElement: TPasElement);virtual;
|
||||||
procedure WriteType(AType: TPasType; Full : Boolean = True);virtual;
|
procedure WriteType(AType: TPasType; Full : Boolean = True);virtual;
|
||||||
@ -247,10 +248,19 @@ begin
|
|||||||
WriteProcImpl(TProcedureBody(AElement))
|
WriteProcImpl(TProcedureBody(AElement))
|
||||||
else if AElement.InheritsFrom(TPasImplCommand) or AElement.InheritsFrom(TPasImplCommands) then
|
else if AElement.InheritsFrom(TPasImplCommand) or AElement.InheritsFrom(TPasImplCommands) then
|
||||||
WriteImplElement(TPasImplElement(AElement),false)
|
WriteImplElement(TPasImplElement(AElement),false)
|
||||||
else
|
else if AElement.InheritsFrom(TPasResString) then
|
||||||
|
WriteResourceString(TPasResString(AElement))
|
||||||
|
else
|
||||||
raise EPasWriter.CreateFmt('Writing not implemented for %s nodes',[AElement.ElementTypeName]);
|
raise EPasWriter.CreateFmt('Writing not implemented for %s nodes',[AElement.ElementTypeName]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPasWriter.WriteResourceString(aStr : TPasResString);
|
||||||
|
|
||||||
|
begin
|
||||||
|
PrepareDeclSection('resourcestring');
|
||||||
|
AddLn(Astr.GetDeclaration(True)+';');
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TPasWriter.WriteEnumType(AType: TPasEnumType);
|
procedure TPasWriter.WriteEnumType(AType: TPasEnumType);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user