mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 19:29:18 +02:00
* Force ampersand in EscaleKeyword
This commit is contained in:
parent
fa9d77e67e
commit
9af13b2731
@ -66,7 +66,7 @@ Type
|
|||||||
Procedure Indent;
|
Procedure Indent;
|
||||||
Procedure Undent;
|
Procedure Undent;
|
||||||
Function IsKeyWord (Const S : String) : Boolean;
|
Function IsKeyWord (Const S : String) : Boolean;
|
||||||
Function EscapeKeyWord(Const S : String) : String;
|
Function EscapeKeyWord(Const S : String; ForceAmpersand : Boolean = false) : String;
|
||||||
Function MakePascalString(S: String; AddQuotes: Boolean=False): String;
|
Function MakePascalString(S: String; AddQuotes: Boolean=False): String;
|
||||||
Function PrettyPrint(Const S: string): String;
|
Function PrettyPrint(Const S: string): String;
|
||||||
Procedure AddLn(Const Aline: string);
|
Procedure AddLn(Const Aline: string);
|
||||||
@ -126,11 +126,14 @@ begin
|
|||||||
Result:=Pos(';'+lowercase(S)+';',KW)<>0;
|
Result:=Pos(';'+lowercase(S)+';',KW)<>0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalCodeGenerator.EscapeKeyWord(const S: String): String;
|
function TPascalCodeGenerator.EscapeKeyWord(const S: String; ForceAmpersand : Boolean = false): String;
|
||||||
begin
|
begin
|
||||||
Result:=S;
|
Result:=S;
|
||||||
if IsKeyWord(S) then
|
if IsKeyWord(S) then
|
||||||
Result:=KeywordPrefix+Result+KeywordSuffix
|
if ForceAmpersand then
|
||||||
|
Result:='&'+Result
|
||||||
|
else
|
||||||
|
Result:=KeywordPrefix+Result+KeywordSuffix
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPascalCodeGenerator.AddLn(const Aline: string);
|
procedure TPascalCodeGenerator.AddLn(const Aline: string);
|
||||||
|
Loading…
Reference in New Issue
Block a user