mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 07:36:19 +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(
|
function TFindDeclarationTool.FindUnitInAllUsesSections(
|
||||||
const AnUnitName: string; out NamePos, InPos: TAtomPosition): boolean;
|
const AnUnitName: string; out NamePos, InPos: TAtomPosition): boolean;
|
||||||
var SectionNode, UsesNode: TCodeTreeNode;
|
var SectionNode, UsesNode: TCodeTreeNode;
|
||||||
|
|
||||||
|
procedure RaiseInvalidUnitName;
|
||||||
|
begin
|
||||||
|
raise Exception.Create('invalid unit name '+AnUnitName);
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
NamePos.StartPos:=-1;
|
NamePos.StartPos:=-1;
|
||||||
InPos.StartPos:=-1;
|
InPos.StartPos:=-1;
|
||||||
|
if not IsDottedIdentifier(AnUnitName) then
|
||||||
|
RaiseInvalidUnitName;
|
||||||
BuildTree(lsrImplementationUsesSectionEnd);
|
BuildTree(lsrImplementationUsesSectionEnd);
|
||||||
SectionNode:=Tree.Root;
|
SectionNode:=Tree.Root;
|
||||||
while (SectionNode<>nil) and (SectionNode.Desc in [ctnProgram, ctnUnit,
|
while (SectionNode<>nil) and (SectionNode.Desc in [ctnProgram, ctnUnit,
|
||||||
|
Loading…
Reference in New Issue
Block a user