mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 13:20:26 +02:00
codetools: fixed FindUnitInUsesSection
git-svn-id: trunk@20302 -
This commit is contained in:
parent
e776d10bc7
commit
124bcb7012
@ -1749,13 +1749,17 @@ begin
|
|||||||
NamePos:=CleanAtomPosition;
|
NamePos:=CleanAtomPosition;
|
||||||
InPos:=CleanAtomPosition;
|
InPos:=CleanAtomPosition;
|
||||||
if (UsesNode=nil) or (AnUnitName='') or (length(AnUnitName)>255)
|
if (UsesNode=nil) or (AnUnitName='') or (length(AnUnitName)>255)
|
||||||
or (UsesNode.Desc<>ctnUsesSection) then exit;
|
or (UsesNode.Desc<>ctnUsesSection) then begin
|
||||||
|
DebugLn(['TFindDeclarationTool.FindUnitInUsesSection invalid AnUnitName']);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
MoveCursorToNodeStart(UsesNode);
|
MoveCursorToNodeStart(UsesNode);
|
||||||
ReadNextAtom; // read 'uses'
|
ReadNextAtom; // read 'uses'
|
||||||
repeat
|
repeat
|
||||||
ReadNextAtom; // read name
|
ReadNextAtom; // read name
|
||||||
if AtomIsChar(';') then break;
|
if AtomIsChar(';') then break;
|
||||||
if AtomIs(AnUnitName) then begin
|
if (CurPos.StartPos>SrcLen) then break;
|
||||||
|
if CompareSrcIdentifiers(CurPos.StartPos,@AnUnitName[1]) then begin
|
||||||
NamePos:=CurPos;
|
NamePos:=CurPos;
|
||||||
InPos.StartPos:=-1;
|
InPos.StartPos:=-1;
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
@ -1773,7 +1777,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
if AtomIsChar(';') then break;
|
if AtomIsChar(';') then break;
|
||||||
if not AtomIsChar(',') then break;
|
if not AtomIsChar(',') then break;
|
||||||
until (CurPos.StartPos>SrcLen);;
|
until (CurPos.StartPos>SrcLen);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFindDeclarationTool.FindUnitInAllUsesSections(
|
function TFindDeclarationTool.FindUnitInAllUsesSections(
|
||||||
@ -1783,7 +1787,10 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
NamePos.StartPos:=-1;
|
NamePos.StartPos:=-1;
|
||||||
InPos.StartPos:=-1;
|
InPos.StartPos:=-1;
|
||||||
if (AnUnitName='') or (length(AnUnitName)>255) then exit;
|
if (AnUnitName='') or (length(AnUnitName)>255) then begin
|
||||||
|
DebugLn(['TFindDeclarationTool.FindUnitInAllUsesSections invalid AnUnitName']);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
BuildTree(false);
|
BuildTree(false);
|
||||||
SectionNode:=Tree.Root;
|
SectionNode:=Tree.Root;
|
||||||
while (SectionNode<>nil) and (SectionNode.Desc in [ctnProgram, ctnUnit,
|
while (SectionNode<>nil) and (SectionNode.Desc in [ctnProgram, ctnUnit,
|
||||||
|
@ -403,7 +403,6 @@ begin
|
|||||||
|
|
||||||
// update {$I filename} directive
|
// update {$I filename} directive
|
||||||
Filename := ExtractFileName(lrsFileName);
|
Filename := ExtractFileName(lrsFileName);
|
||||||
DebugLn(['TProjectResources.UpdateMainSourceFile AAA1 ',CodeBuf.Filename]);
|
|
||||||
if CodeToolBoss.FindIncludeDirective(CodeBuf, 1, 1,
|
if CodeToolBoss.FindIncludeDirective(CodeBuf, 1, 1,
|
||||||
NewCode, NewX, NewY,
|
NewCode, NewX, NewY,
|
||||||
NewTopLine, Filename, false) then
|
NewTopLine, Filename, false) then
|
||||||
|
Loading…
Reference in New Issue
Block a user