mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-22 21:29:39 +01:00
Replace deprecated LazIsValidIdent with IsValidIdent.
This commit is contained in:
parent
3aae5b8b86
commit
f9c4b5d7d1
@ -7,7 +7,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils,
|
Classes, SysUtils,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazFileUtils, LazStringUtils;
|
LazFileUtils;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -108,12 +108,12 @@ implementation
|
|||||||
|
|
||||||
function IsValidUnitName(AUnitName: String): Boolean;
|
function IsValidUnitName(AUnitName: String): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := LazIsValidIdent(AUnitName, True, True);
|
Result := IsValidIdent(AUnitName, True, True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IsValidPkgName(APkgName: String): Boolean;
|
function IsValidPkgName(APkgName: String): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := LazIsValidIdent(APkgName, True, True);
|
Result := IsValidIdent(APkgName, True, True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function PackageFileNameIsValid(const AFilename: string): boolean;
|
function PackageFileNameIsValid(const AFilename: string): boolean;
|
||||||
|
|||||||
@ -3003,7 +3003,7 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if (TreeOfPCodeXYPosition=nil) or (TreeOfPCodeXYPosition.Count=0) then
|
if (TreeOfPCodeXYPosition=nil) or (TreeOfPCodeXYPosition.Count=0) then
|
||||||
exit(true);
|
exit(true);
|
||||||
if not LazIsValidIdent(NewIdentifier,True,True) then exit;
|
if not IsValidIdent(NewIdentifier,True,True) then exit;
|
||||||
|
|
||||||
ClearCurCodeTool;
|
ClearCurCodeTool;
|
||||||
SourceChangeCache.Clear;
|
SourceChangeCache.Clear;
|
||||||
|
|||||||
@ -726,7 +726,7 @@ begin
|
|||||||
UnitLinkLen:=UnitLinkEnd-UnitLinkStart;
|
UnitLinkLen:=UnitLinkEnd-UnitLinkStart;
|
||||||
if UnitLinkLen>0 then begin
|
if UnitLinkLen>0 then begin
|
||||||
TheUnitName:=copy(UnitLinks,UnitLinkStart,UnitLinkLen);
|
TheUnitName:=copy(UnitLinks,UnitLinkStart,UnitLinkLen);
|
||||||
if LazIsValidIdent(TheUnitName,true,true) then begin
|
if IsValidIdent(TheUnitName,true,true) then begin
|
||||||
UnitLinkStart:=UnitLinkEnd+1;
|
UnitLinkStart:=UnitLinkEnd+1;
|
||||||
UnitLinkEnd:=UnitLinkStart;
|
UnitLinkEnd:=UnitLinkStart;
|
||||||
while (UnitLinkEnd<=length(UnitLinks))
|
while (UnitLinkEnd<=length(UnitLinks))
|
||||||
@ -1761,7 +1761,7 @@ begin
|
|||||||
aNameSpace:=NameSpaces;
|
aNameSpace:=NameSpaces;
|
||||||
NameSpaces:='';
|
NameSpaces:='';
|
||||||
end;
|
end;
|
||||||
if LazIsValidIdent(aNameSpace,true,true) then begin
|
if IsValidIdent(aNameSpace,true,true) then begin
|
||||||
aName:=aNameSpace+'.'+AUnitName;
|
aName:=aNameSpace+'.'+AUnitName;
|
||||||
Result:=FindUnitSourceInCompletePath(aName,InFilename,AnyCase,
|
Result:=FindUnitSourceInCompletePath(aName,InFilename,AnyCase,
|
||||||
FPCSrcSearchRequiresPPU,'');
|
FPCSrcSearchRequiresPPU,'');
|
||||||
|
|||||||
@ -35,9 +35,9 @@ uses
|
|||||||
dynlibs,
|
dynlibs,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazStringUtils, LazUTF8,
|
LazUTF8, LazFileUtils,
|
||||||
// Codetools
|
// Codetools
|
||||||
PPUParser, CodeTree, FileProcs, LazFileUtils, BasicCodeTools, CodeGraph,
|
PPUParser, CodeTree, FileProcs, BasicCodeTools, CodeGraph,
|
||||||
CodeToolManager, CodeToolsStructs;
|
CodeToolManager, CodeToolsStructs;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -671,7 +671,7 @@ begin
|
|||||||
System.Delete(GroupName,i,1);
|
System.Delete(GroupName,i,1);
|
||||||
if (Groupname='') then continue;
|
if (Groupname='') then continue;
|
||||||
Groupname:=FPCPPUGroupPrefix+LowerCase(Groupname);
|
Groupname:=FPCPPUGroupPrefix+LowerCase(Groupname);
|
||||||
if (not LazIsValidIdent(Groupname,true,true)) then continue;
|
if (not IsValidIdent(Groupname,true,true)) then continue;
|
||||||
AddFPCGroup(GroupName,AppendPathDelim(FPCPPUBaseDir)+FileInfo.Name);
|
AddFPCGroup(GroupName,AppendPathDelim(FPCPPUBaseDir)+FileInfo.Name);
|
||||||
end;
|
end;
|
||||||
until FindNextUTF8(FileInfo)<>0;
|
until FindNextUTF8(FileInfo)<>0;
|
||||||
@ -700,7 +700,7 @@ begin
|
|||||||
if not FilenameExtIs(Filename,'ppu',true) then continue;
|
if not FilenameExtIs(Filename,'ppu',true) then continue;
|
||||||
AUnitName:=ExtractFileNameOnly(Filename);
|
AUnitName:=ExtractFileNameOnly(Filename);
|
||||||
Filename:=AppendPathDelim(Directory)+Filename;
|
Filename:=AppendPathDelim(Directory)+Filename;
|
||||||
if not LazIsValidIdent(AUnitName,true,true) then begin
|
if not IsValidIdent(AUnitName,true,true) then begin
|
||||||
DebugLn(['TPPUGroups.AddFPCGroup NOTE: invalid ppu name: ',Filename]);
|
DebugLn(['TPPUGroups.AddFPCGroup NOTE: invalid ppu name: ',Filename]);
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -37,7 +37,7 @@ uses
|
|||||||
// LazControls
|
// LazControls
|
||||||
CheckBoxThemed,
|
CheckBoxThemed,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
FileUtil, StringHashList, LazMethodList, LazLoggerBase, LazUtilities, LazStringUtils,
|
FileUtil, StringHashList, LazMethodList, LazLoggerBase, LazUtilities,
|
||||||
GraphType, FPCAdds, // for StrToQWord in older fpc versions
|
GraphType, FPCAdds, // for StrToQWord in older fpc versions
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
ObjInspStrConsts, PropEditUtils, TextTools,
|
ObjInspStrConsts, PropEditUtils, TextTools,
|
||||||
@ -5485,7 +5485,7 @@ var
|
|||||||
begin
|
begin
|
||||||
NewMethodName := GetValue;
|
NewMethodName := GetValue;
|
||||||
{$IFDEF VerboseMethodPropEdit}
|
{$IFDEF VerboseMethodPropEdit}
|
||||||
debugln(['TMethodPropertyEditor.Edit OldValue="',NewMethodName,'" FromLookupRoot=',(LazIsValidIdent(NewMethodName, True, True) and PropertyHook.MethodFromLookupRoot(GetMethodValue))]);
|
debugln(['TMethodPropertyEditor.Edit OldValue="',NewMethodName,'" FromLookupRoot=',(IsValidIdent(NewMethodName, True, True) and PropertyHook.MethodFromLookupRoot(GetMethodValue))]);
|
||||||
DumpStack;
|
DumpStack;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if IsValidIdent(NewMethodName)
|
if IsValidIdent(NewMethodName)
|
||||||
@ -7017,7 +7017,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Result.Code := nil;
|
Result.Code := nil;
|
||||||
Result.Data := nil;
|
Result.Data := nil;
|
||||||
if LazIsValidIdent(aName,true,true) and Assigned(ATypeInfo) then
|
if IsValidIdent(aName,true,true) and Assigned(ATypeInfo) then
|
||||||
begin
|
begin
|
||||||
i := GetHandlerCount(htCreateMethod);
|
i := GetHandlerCount(htCreateMethod);
|
||||||
while GetNextHandlerIndex(htCreateMethod, i) do
|
while GetNextHandlerIndex(htCreateMethod, i) do
|
||||||
|
|||||||
@ -66,7 +66,7 @@ uses
|
|||||||
LCLType, LclIntf, Forms, Controls, StdCtrls, Dialogs, ComCtrls,
|
LCLType, LclIntf, Forms, Controls, StdCtrls, Dialogs, ComCtrls,
|
||||||
ActnList, XMLPropStorage, ExtCtrls,
|
ActnList, XMLPropStorage, ExtCtrls,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazFileUtils, LazStringUtils, LazFileCache, LazLoggerBase, LazTracer,
|
LazFileUtils, LazFileCache, LazLoggerBase, LazTracer,
|
||||||
// Codetools
|
// Codetools
|
||||||
CodeToolManager, FileProcs,
|
CodeToolManager, FileProcs,
|
||||||
// IDEIntf
|
// IDEIntf
|
||||||
@ -389,7 +389,7 @@ begin
|
|||||||
CurOwner:=nil;
|
CurOwner:=nil;
|
||||||
CurProject:=nil;
|
CurProject:=nil;
|
||||||
CurPkg:=nil;
|
CurPkg:=nil;
|
||||||
if LazIsValidIdent(IDEItem,true) then begin
|
if IsValidIdent(IDEItem,true,true) then begin
|
||||||
// package
|
// package
|
||||||
CurPkg:=PackageEditingInterface.FindPackageWithName(IDEItem);
|
CurPkg:=PackageEditingInterface.FindPackageWithName(IDEItem);
|
||||||
CurOwner:=CurPkg;
|
CurOwner:=CurPkg;
|
||||||
|
|||||||
@ -1847,7 +1847,7 @@ begin
|
|||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
CurUnitName:=ExtractFilenameOnly(CurFilename);
|
CurUnitName:=ExtractFilenameOnly(CurFilename);
|
||||||
if not LazIsValidIdent(CurUnitName) then
|
if not IsValidIdent(CurUnitName) then
|
||||||
continue;
|
continue;
|
||||||
//DebugLn(['TBuildManager.CheckUnitPathForAmbiguousPascalFiles ',CurUnitName,' ',CurFilename]);
|
//DebugLn(['TBuildManager.CheckUnitPathForAmbiguousPascalFiles ',CurUnitName,' ',CurFilename]);
|
||||||
// check if unit already found
|
// check if unit already found
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user