mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 22:09:16 +02:00
h2pas: add missing pointer types now only checks identifiers in types
git-svn-id: trunk@14111 -
This commit is contained in:
parent
e585127ec0
commit
53b5ee1c6c
@ -4261,6 +4261,27 @@ var
|
|||||||
Result:=CodeToolBoss.SourceChangeCache.Replace(gtNewLine,gtNewLine,
|
Result:=CodeToolBoss.SourceChangeCache.Replace(gtNewLine,gtNewLine,
|
||||||
InsertPos,InsertPos,NewTxt);
|
InsertPos,InsertPos,NewTxt);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function CheckTypes: boolean;
|
||||||
|
var
|
||||||
|
Node: TCodeTreeNode;
|
||||||
|
begin
|
||||||
|
Node:=Tool.Tree.Root;
|
||||||
|
while Node<>nil do begin
|
||||||
|
if Node.Desc in AllPascalTypes then begin
|
||||||
|
Tool.MoveCursorToCleanPos(Node.StartPos);
|
||||||
|
while Tool.CurPos.StartPos<Node.EndPos do begin
|
||||||
|
Tool.ReadNextAtom;
|
||||||
|
if Tool.CurPos.StartPos>=Node.EndPos then break;
|
||||||
|
if (Tool.CurPos.Flag=cafWord) then
|
||||||
|
CheckIdentifier(Tool.CurPos.StartPos);
|
||||||
|
end;
|
||||||
|
Node:=Node.NextSkipChilds;
|
||||||
|
end else
|
||||||
|
Node:=Node.Next;
|
||||||
|
end;
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
function AddNeededPointerTypesToSource: boolean;
|
function AddNeededPointerTypesToSource: boolean;
|
||||||
var
|
var
|
||||||
@ -4304,13 +4325,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
// check all used identifiers
|
// check all used identifiers
|
||||||
Tool.MoveCursorToCleanPos(1);
|
if not CheckTypes then exit;
|
||||||
while Tool.CurPos.StartPos<Tool.SrcLen do begin
|
|
||||||
Tool.ReadNextAtom;
|
|
||||||
if Tool.CurPos.StartPos>=Tool.SrcLen then break;
|
|
||||||
if (Tool.CurPos.Flag=cafWord) then
|
|
||||||
CheckIdentifier(Tool.CurPos.StartPos);
|
|
||||||
end;
|
|
||||||
// add all needed pointer types
|
// add all needed pointer types
|
||||||
if not AddNeededPointerTypesToSource then exit;
|
if not AddNeededPointerTypesToSource then exit;
|
||||||
finally
|
finally
|
||||||
|
Loading…
Reference in New Issue
Block a user