mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 19:16:16 +02:00
CodeTools: ofall() code macro: keep & prefixes. Issue #35801
git-svn-id: trunk@62244 -
This commit is contained in:
parent
fde024d03d
commit
b21a3831c1
@ -107,7 +107,7 @@ procedure GetIdentStartEndAtPosition(const Source:string; Position:integer;
|
||||
out IdentStart,IdentEnd:integer);
|
||||
function GetIdentStartPosition(const Source:string; Position:integer): integer;
|
||||
function GetIdentLen(Identifier: PChar): integer;
|
||||
function GetIdentifier(Identifier: PChar): string;
|
||||
function GetIdentifier(Identifier: PChar; const aSkipAmp: Boolean = True): string;
|
||||
function FindNextIdentifier(const Source: string; StartPos, MaxPos: integer): integer;
|
||||
function FindNextIdentifierSkipStrings(const Source: string;
|
||||
StartPos, MaxPos: integer): integer;
|
||||
@ -4719,17 +4719,22 @@ begin
|
||||
+'Actual: '+dbgstr(Actual,1,d-1)+'|'+dbgstr(Actual,d,length(Actual));
|
||||
end;
|
||||
|
||||
function GetIdentifier(Identifier: PChar): string;
|
||||
function GetIdentifier(Identifier: PChar; const aSkipAmp: Boolean): string;
|
||||
var len: integer;
|
||||
begin
|
||||
if (Identifier=nil) then begin
|
||||
Result:='';
|
||||
exit;
|
||||
end;
|
||||
if (Identifier^='&') and (IsIdentChar[Identifier[1]]) then
|
||||
inc(Identifier);
|
||||
if IsIdentStartChar[Identifier^] then begin
|
||||
if IsIdentStartChar[Identifier^] or ((Identifier^='&') and (IsIdentStartChar[Identifier[1]])) then begin
|
||||
len:=0;
|
||||
if (Identifier^='&') then
|
||||
begin
|
||||
if aSkipAmp then
|
||||
inc(Identifier)
|
||||
else
|
||||
inc(len);
|
||||
end;
|
||||
while (IsIdentChar[Identifier[len]]) do inc(len);
|
||||
SetLength(Result,len);
|
||||
if len>0 then
|
||||
|
@ -3765,7 +3765,7 @@ begin
|
||||
|
||||
Node:=Node.FirstChild;
|
||||
while Node<>nil do begin
|
||||
List.Add(EnumPrefix+GetIdentifier(@Tool.Src[Node.StartPos]));
|
||||
List.Add(EnumPrefix+GetIdentifier(@Tool.Src[Node.StartPos], False));
|
||||
Node:=Node.NextBrother;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user