mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 11:59:18 +02:00
increased rpm version to 0.9.2.2
git-svn-id: trunk@6027 -
This commit is contained in:
parent
6ec01de193
commit
5ecbd3487f
@ -666,6 +666,8 @@ type
|
|||||||
var ListOfPCodeXYPosition: TList): boolean;
|
var ListOfPCodeXYPosition: TList): boolean;
|
||||||
function FindReferences(const CursorPos: TCodeXYPosition;
|
function FindReferences(const CursorPos: TCodeXYPosition;
|
||||||
SkipComments: boolean; var ListOfPCodeXYPosition: TList): boolean;
|
SkipComments: boolean; var ListOfPCodeXYPosition: TList): boolean;
|
||||||
|
function CleanPosIsDeclaration(CleanPos: integer;
|
||||||
|
Node: TCodeTreeNode): boolean;
|
||||||
|
|
||||||
function JumpToNode(ANode: TCodeTreeNode;
|
function JumpToNode(ANode: TCodeTreeNode;
|
||||||
var NewPos: TCodeXYPosition; var NewTopLine: integer;
|
var NewPos: TCodeXYPosition; var NewTopLine: integer;
|
||||||
@ -991,32 +993,6 @@ var CleanCursorPos: integer;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CursorOnDeclaration: boolean;
|
|
||||||
|
|
||||||
function InNodeIdentifier: boolean;
|
|
||||||
var
|
|
||||||
IdentStartPos, IdentEndPos: integer;
|
|
||||||
begin
|
|
||||||
GetIdentStartEndAtPosition(Src,CleanCursorPos,IdentStartPos,IdentEndPos);
|
|
||||||
if (IdentEndPos>IdentStartPos) and (IdentStartPos=CursorNode.StartPos)
|
|
||||||
then begin
|
|
||||||
NewTool:=Self;
|
|
||||||
NewNode:=CursorNode;
|
|
||||||
Result:=JumpToNode(CursorNode,NewPos,NewTopLine,false);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
|
||||||
Result:=false;
|
|
||||||
if CursorNode=nil then exit;
|
|
||||||
if (CursorNode.Desc in AllIdentifierDefinitions) then begin
|
|
||||||
if NodeIsForwardDeclaration(CursorNode) then exit;
|
|
||||||
Result:=InNodeIdentifier;
|
|
||||||
end else if (CursorNode.Desc=ctnProcedureHead) then begin
|
|
||||||
Result:=InNodeIdentifier;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
var
|
var
|
||||||
CleanPosInFront: integer;
|
CleanPosInFront: integer;
|
||||||
CursorAtIdentifier: boolean;
|
CursorAtIdentifier: boolean;
|
||||||
@ -1039,10 +1015,14 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
// find CodeTreeNode at cursor
|
// find CodeTreeNode at cursor
|
||||||
if (Tree.Root<>nil) and (Tree.Root.StartPos<=CleanCursorPos) then begin
|
if (Tree.Root<>nil) and (Tree.Root.StartPos<=CleanCursorPos) then begin
|
||||||
CursorNode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
CursorNode:=BuildSubTreeAndFindDeepestNodeAtPos(Tree.Root,CleanCursorPos,
|
||||||
if (fsfFindMainDeclaration in SearchSmartFlags) and CursorOnDeclaration
|
true);
|
||||||
|
if (fsfFindMainDeclaration in SearchSmartFlags)
|
||||||
|
and CleanPosIsDeclaration(CleanCursorPos,CursorNode)
|
||||||
then begin
|
then begin
|
||||||
Result:=true;
|
NewTool:=Self;
|
||||||
|
NewNode:=CursorNode;
|
||||||
|
Result:=JumpToNode(CursorNode,NewPos,NewTopLine,false);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
CleanPosInFront:=CursorNode.StartPos;
|
CleanPosInFront:=CursorNode.StartPos;
|
||||||
@ -2981,31 +2961,6 @@ var
|
|||||||
//debugln('TFindDeclarationTool.FindReferences.AddCodePosition line=',dbgs(NewCodePos.Y),' col=',dbgs(NewCodePos.X));
|
//debugln('TFindDeclarationTool.FindReferences.AddCodePosition line=',dbgs(NewCodePos.Y),' col=',dbgs(NewCodePos.X));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CursorOnDeclaration: boolean;
|
|
||||||
|
|
||||||
function InNodeIdentifier: boolean;
|
|
||||||
var
|
|
||||||
IdentStartPos, IdentEndPos: integer;
|
|
||||||
begin
|
|
||||||
GetIdentStartEndAtPosition(Src,StartPos,IdentStartPos,IdentEndPos);
|
|
||||||
//debugln('InNodeIdentifier ',dbgs(StartPos),' ',dbgs(IdentStartPos),' ',dbgs(IdentEndPos),' ',dbgs(CursorNode.StartPos));
|
|
||||||
if (IdentEndPos>IdentStartPos) and (IdentStartPos=CursorNode.StartPos)
|
|
||||||
then begin
|
|
||||||
Result:=true;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
|
||||||
Result:=false;
|
|
||||||
if CursorNode=nil then exit;
|
|
||||||
if (CursorNode.Desc in AllIdentifierDefinitions) then begin
|
|
||||||
if NodeIsForwardDeclaration(CursorNode) then exit;
|
|
||||||
Result:=InNodeIdentifier;
|
|
||||||
end else if (CursorNode.Desc=ctnProcedureHead) then begin
|
|
||||||
Result:=InNodeIdentifier;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
ListOfPCodeXYPosition:=nil;
|
ListOfPCodeXYPosition:=nil;
|
||||||
@ -3047,7 +3002,7 @@ begin
|
|||||||
if (DeclarationTool=Self) and (StartPos=CleanDeclCursorPos) then
|
if (DeclarationTool=Self) and (StartPos=CleanDeclCursorPos) then
|
||||||
// declaration itself found
|
// declaration itself found
|
||||||
AddReference
|
AddReference
|
||||||
else if CursorOnDeclaration then
|
else if CleanPosIsDeclaration(StartPos,CursorNode) then
|
||||||
// this identifier is another declaration with the same name
|
// this identifier is another declaration with the same name
|
||||||
else begin
|
else begin
|
||||||
// find declaration
|
// find declaration
|
||||||
@ -3098,6 +3053,54 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------------------------------
|
||||||
|
function TFindDeclarationTool.CleanPosIsDeclaration(CleanPos: integer;
|
||||||
|
Node: TCodeTreeNode): boolean;
|
||||||
|
|
||||||
|
Node should be the deepest node at CleanPos, and all sub trees built.
|
||||||
|
See BuildSubTree
|
||||||
|
-------------------------------------------------------------------------------}
|
||||||
|
function TFindDeclarationTool.CleanPosIsDeclaration(CleanPos: integer;
|
||||||
|
Node: TCodeTreeNode): boolean;
|
||||||
|
|
||||||
|
function InNodeIdentifier: boolean;
|
||||||
|
var
|
||||||
|
IdentStartPos, IdentEndPos: integer;
|
||||||
|
NodeIdentStartPos: Integer;
|
||||||
|
begin
|
||||||
|
NodeIdentStartPos:=Node.StartPos;
|
||||||
|
if Node.Desc in [ctnProperty,ctnGlobalProperty] then begin
|
||||||
|
if not MoveCursorToPropName(Node) then exit;
|
||||||
|
NodeIdentStartPos:=CurPos.StartPos;
|
||||||
|
end;
|
||||||
|
GetIdentStartEndAtPosition(Src,CleanPos,IdentStartPos,IdentEndPos);
|
||||||
|
if (IdentEndPos>IdentStartPos) and (IdentStartPos=NodeIdentStartPos)
|
||||||
|
then begin
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result:=false;
|
||||||
|
if Node=nil then exit;
|
||||||
|
case Node.Desc of
|
||||||
|
|
||||||
|
ctnTypeDefinition,ctnVarDefinition,ctnConstDefinition:
|
||||||
|
begin
|
||||||
|
if NodeIsForwardDeclaration(Node) then exit;
|
||||||
|
Result:=InNodeIdentifier;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ctnProcedureHead, ctnProperty, ctnGlobalProperty:
|
||||||
|
Result:=InNodeIdentifier;
|
||||||
|
|
||||||
|
ctnBeginBlock,ctnClass,ctnProcedure:
|
||||||
|
if (Node.SubDesc and ctnsForwardDeclaration)>0 then
|
||||||
|
RaiseException('TFindDeclarationTool.CleanPosIsDeclaration Node not expanded');
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TFindDeclarationTool.JumpToNode(ANode: TCodeTreeNode;
|
function TFindDeclarationTool.JumpToNode(ANode: TCodeTreeNode;
|
||||||
var NewPos: TCodeXYPosition; var NewTopLine: integer;
|
var NewPos: TCodeXYPosition; var NewTopLine: integer;
|
||||||
IgnoreJumpCentered: boolean): boolean;
|
IgnoreJumpCentered: boolean): boolean;
|
||||||
|
@ -63,6 +63,7 @@ type
|
|||||||
function ExtractPropType(PropNode: TCodeTreeNode;
|
function ExtractPropType(PropNode: TCodeTreeNode;
|
||||||
InUpperCase, EmptyIfIndexed: boolean): string;
|
InUpperCase, EmptyIfIndexed: boolean): string;
|
||||||
function MoveCursorToPropType(PropNode: TCodeTreeNode): boolean;
|
function MoveCursorToPropType(PropNode: TCodeTreeNode): boolean;
|
||||||
|
function MoveCursorToPropName(PropNode: TCodeTreeNode): boolean;
|
||||||
function ExtractPropName(PropNode: TCodeTreeNode;
|
function ExtractPropName(PropNode: TCodeTreeNode;
|
||||||
InUpperCase: boolean): string;
|
InUpperCase: boolean): string;
|
||||||
function ExtractProperty(PropNode: TCodeTreeNode;
|
function ExtractProperty(PropNode: TCodeTreeNode;
|
||||||
@ -642,6 +643,22 @@ begin
|
|||||||
AtomIsIdentifier(true);
|
AtomIsIdentifier(true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TPascalReaderTool.MoveCursorToPropName(PropNode: TCodeTreeNode
|
||||||
|
): boolean;
|
||||||
|
begin
|
||||||
|
Result:=false;
|
||||||
|
if (PropNode=nil)
|
||||||
|
or ((PropNode.Desc<>ctnProperty) and (PropNode.Desc<>ctnGlobalProperty)) then
|
||||||
|
exit;
|
||||||
|
MoveCursorToNodeStart(PropNode);
|
||||||
|
ReadNextAtom;
|
||||||
|
if (PropNode.Desc=ctnProperty) then begin
|
||||||
|
if (not UpAtomIs('PROPERTY')) then exit;
|
||||||
|
ReadNextAtom;
|
||||||
|
end;
|
||||||
|
AtomIsIdentifier(true);
|
||||||
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.ProcNodeHasSpecifier(ProcNode: TCodeTreeNode;
|
function TPascalReaderTool.ProcNodeHasSpecifier(ProcNode: TCodeTreeNode;
|
||||||
ProcSpec: TProcedureSpecifier): boolean;
|
ProcSpec: TProcedureSpecifier): boolean;
|
||||||
begin
|
begin
|
||||||
@ -709,16 +726,7 @@ function TPascalReaderTool.ExtractPropName(PropNode: TCodeTreeNode;
|
|||||||
InUpperCase: boolean): string;
|
InUpperCase: boolean): string;
|
||||||
begin
|
begin
|
||||||
Result:='';
|
Result:='';
|
||||||
if (PropNode=nil)
|
if not MoveCursorToPropName(PropNode) then exit;
|
||||||
or ((PropNode.Desc<>ctnProperty) and (PropNode.Desc<>ctnGlobalProperty)) then
|
|
||||||
exit;
|
|
||||||
MoveCursorToNodeStart(PropNode);
|
|
||||||
ReadNextAtom;
|
|
||||||
if (PropNode.Desc=ctnProperty) then begin
|
|
||||||
if (not UpAtomIs('PROPERTY')) then exit;
|
|
||||||
ReadNextAtom;
|
|
||||||
end;
|
|
||||||
AtomIsIdentifier(true);
|
|
||||||
if InUpperCase then
|
if InUpperCase then
|
||||||
Result:=GetUpAtom
|
Result:=GetUpAtom
|
||||||
else
|
else
|
||||||
|
@ -16,7 +16,7 @@ if [ "x$FPCRPM" = "x" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
Date=$Year$Month$Day
|
Date=$Year$Month$Day
|
||||||
LazVersion=0.9.2.1
|
LazVersion=0.9.2.2
|
||||||
LazRelease=`echo $FPCRPM | sed -e 's/-/_/g'`
|
LazRelease=`echo $FPCRPM | sed -e 's/-/_/g'`
|
||||||
SrcTGZ=lazarus-$Date.tgz
|
SrcTGZ=lazarus-$Date.tgz
|
||||||
TmpDir=/tmp/lazarus$LazVersion
|
TmpDir=/tmp/lazarus$LazVersion
|
||||||
|
Loading…
Reference in New Issue
Block a user