mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 08:29:06 +02:00
codetools: fixed compilation with fpc<3.1.1
git-svn-id: branches/fixes_1_8@54764 -
This commit is contained in:
parent
7e9a65a530
commit
5afb97dafb
@ -293,7 +293,6 @@ function CompareUnitLinkNodes(NodeData1, NodeData2: Pointer): integer;
|
||||
function CompareUnitNameWithUnitLinkNode(AUnitName: Pointer;
|
||||
NodeData: pointer): integer;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
const
|
||||
@ -539,6 +538,43 @@ begin
|
||||
Result:=CompareText(String(AUnitName),TUnitFileNameLink(NodeData).Unit_Name);
|
||||
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 }
|
||||
|
||||
function TCTDirectoryCache.GetStrings(const AStringType: TCTDirCacheString
|
||||
|
Loading…
Reference in New Issue
Block a user