mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 08:51:17 +02:00
codetools: fixed compilation with fpc<3.1.1
git-svn-id: trunk@54763 -
This commit is contained in:
parent
093242498d
commit
73b1b38cde
@ -293,7 +293,6 @@ function CompareUnitLinkNodes(NodeData1, NodeData2: Pointer): integer;
|
|||||||
function CompareUnitNameWithUnitLinkNode(AUnitName: Pointer;
|
function CompareUnitNameWithUnitLinkNode(AUnitName: Pointer;
|
||||||
NodeData: pointer): integer;
|
NodeData: pointer): integer;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -539,6 +538,43 @@ begin
|
|||||||
Result:=CompareText(String(AUnitName),TUnitFileNameLink(NodeData).Unit_Name);
|
Result:=CompareText(String(AUnitName),TUnitFileNameLink(NodeData).Unit_Name);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IF FPC_FULLVERSION<30101}
|
||||||
|
function IsValidIdent(const Ident: string; AllowDots: Boolean = False; StrictDots: Boolean = False): Boolean;
|
||||||
|
const
|
||||||
|
Alpha = ['A'..'Z', 'a'..'z', '_'];
|
||||||
|
AlphaNum = Alpha + ['0'..'9'];
|
||||||
|
Dot = '.';
|
||||||
|
var
|
||||||
|
First: Boolean;
|
||||||
|
I, Len: Integer;
|
||||||
|
begin
|
||||||
|
Len := Length(Ident);
|
||||||
|
if Len < 1 then
|
||||||
|
Exit(False);
|
||||||
|
First := True;
|
||||||
|
for I := 1 to Len do
|
||||||
|
begin
|
||||||
|
if First then
|
||||||
|
begin
|
||||||
|
Result := Ident[I] in Alpha;
|
||||||
|
First := False;
|
||||||
|
end
|
||||||
|
else if AllowDots and (Ident[I] = Dot) then
|
||||||
|
begin
|
||||||
|
if StrictDots then
|
||||||
|
begin
|
||||||
|
Result := I < Len;
|
||||||
|
First := True;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result := Ident[I] in AlphaNum;
|
||||||
|
if not Result then
|
||||||
|
Break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
{ TCTDirectoryCache }
|
{ TCTDirectoryCache }
|
||||||
|
|
||||||
function TCTDirectoryCache.GetStrings(const AStringType: TCTDirCacheString
|
function TCTDirectoryCache.GetStrings(const AStringType: TCTDirCacheString
|
||||||
|
Loading…
Reference in New Issue
Block a user