mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-02 23:38:12 +02:00
codetools: readded check for unitname
git-svn-id: trunk@34096 -
This commit is contained in:
parent
848177ad94
commit
14c6d767c7
@ -1896,10 +1896,18 @@ end;
|
||||
function TFindDeclarationTool.FindUnitInAllUsesSections(
|
||||
const AnUnitName: string; out NamePos, InPos: TAtomPosition): boolean;
|
||||
var SectionNode, UsesNode: TCodeTreeNode;
|
||||
|
||||
procedure RaiseInvalidUnitName;
|
||||
begin
|
||||
raise Exception.Create('invalid unit name '+AnUnitName);
|
||||
end;
|
||||
|
||||
begin
|
||||
Result:=false;
|
||||
NamePos.StartPos:=-1;
|
||||
InPos.StartPos:=-1;
|
||||
if not IsDottedIdentifier(AnUnitName) then
|
||||
RaiseInvalidUnitName;
|
||||
BuildTree(lsrImplementationUsesSectionEnd);
|
||||
SectionNode:=Tree.Root;
|
||||
while (SectionNode<>nil) and (SectionNode.Desc in [ctnProgram, ctnUnit,
|
||||
|
Loading…
Reference in New Issue
Block a user