mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 21:59:07 +02:00
renamed one Rect
git-svn-id: trunk@3828 -
This commit is contained in:
parent
2eacf15226
commit
df9de104a3
@ -236,6 +236,11 @@ type
|
|||||||
// gather identifiers
|
// gather identifiers
|
||||||
function GatherIdentifiers(Code: TCodeBuffer; X,Y: integer): boolean;
|
function GatherIdentifiers(Code: TCodeBuffer; X,Y: integer): boolean;
|
||||||
|
|
||||||
|
// expressions
|
||||||
|
function GetExpressionBounds(Code: TCodeBuffer; X,Y: integer;
|
||||||
|
var StartCode: TCodeBuffer; var StartX, StartY: integer;
|
||||||
|
var EndCode: TCodeBuffer; var EndX, EndY: integer): boolean;
|
||||||
|
|
||||||
// functions for events in the object inspector
|
// functions for events in the object inspector
|
||||||
function GetCompatiblePublishedMethods(Code: TCodeBuffer;
|
function GetCompatiblePublishedMethods(Code: TCodeBuffer;
|
||||||
const AClassName: string; TypeData: PTypeData;
|
const AClassName: string; TypeData: PTypeData;
|
||||||
@ -254,7 +259,8 @@ type
|
|||||||
function CreatePublishedMethod(Code: TCodeBuffer; const AClassName,
|
function CreatePublishedMethod(Code: TCodeBuffer; const AClassName,
|
||||||
NewMethodName: string; ATypeInfo: PTypeInfo): boolean;
|
NewMethodName: string; ATypeInfo: PTypeInfo): boolean;
|
||||||
|
|
||||||
// code completion = auto class completion, auto forward proc completion
|
// code completion = auto class completion, auto forward proc completion,
|
||||||
|
// local var assignment completion, event assignment completion
|
||||||
function CompleteCode(Code: TCodeBuffer; X,Y,TopLine: integer;
|
function CompleteCode(Code: TCodeBuffer; X,Y,TopLine: integer;
|
||||||
var NewCode: TCodeBuffer;
|
var NewCode: TCodeBuffer;
|
||||||
var NewX, NewY, NewTopLine: integer): boolean;
|
var NewX, NewY, NewTopLine: integer): boolean;
|
||||||
@ -792,6 +798,35 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCodeToolManager.GetExpressionBounds(Code: TCodeBuffer; X, Y: integer;
|
||||||
|
var StartCode: TCodeBuffer; var StartX, StartY: integer;
|
||||||
|
var EndCode: TCodeBuffer; var EndX, EndY: integer): boolean;
|
||||||
|
var
|
||||||
|
CursorPos, StartPos, EndPos: TCodeXYPosition;
|
||||||
|
begin
|
||||||
|
Result:=false;
|
||||||
|
{$IFDEF CTDEBUG}
|
||||||
|
writeln('TCodeToolManager.GetExpressionBounds A ',Code.Filename,' x=',x,' y=',y);
|
||||||
|
{$ENDIF}
|
||||||
|
if not InitCurCodeTool(Code) then exit;
|
||||||
|
CursorPos.X:=X;
|
||||||
|
CursorPos.Y:=Y;
|
||||||
|
CursorPos.Code:=Code;
|
||||||
|
try
|
||||||
|
Result:=FCurCodeTool.GetExpressionBounds(CursorPos,StartPos,EndPos);
|
||||||
|
if Result then begin
|
||||||
|
StartCode:=StartPos.Code;
|
||||||
|
StartX:=StartPos.X;
|
||||||
|
StartY:=StartPos.Y;
|
||||||
|
EndCode:=EndPos.Code;
|
||||||
|
EndX:=EndPos.X;
|
||||||
|
EndY:=EndPos.Y;
|
||||||
|
end;
|
||||||
|
except
|
||||||
|
on e: Exception do Result:=HandleException(e);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCodeToolManager.GuessMisplacedIfdefEndif(Code: TCodeBuffer; X,Y: integer;
|
function TCodeToolManager.GuessMisplacedIfdefEndif(Code: TCodeBuffer; X,Y: integer;
|
||||||
var NewCode: TCodeBuffer;
|
var NewCode: TCodeBuffer;
|
||||||
var NewX, NewY, NewTopLine: integer): boolean;
|
var NewX, NewY, NewTopLine: integer): boolean;
|
||||||
|
@ -68,7 +68,6 @@ type
|
|||||||
EParserAbort = class(ECodeToolError)
|
EParserAbort = class(ECodeToolError)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TCustomCodeTool }
|
{ TCustomCodeTool }
|
||||||
|
|
||||||
TCustomCodeTool = class(TObject)
|
TCustomCodeTool = class(TObject)
|
||||||
@ -149,6 +148,8 @@ type
|
|||||||
var Caret:TCodeXYPosition): boolean; // true=ok, false=invalid CleanPos
|
var Caret:TCodeXYPosition): boolean; // true=ok, false=invalid CleanPos
|
||||||
function CleanPosToCaretAndTopLine(CleanPos: integer;
|
function CleanPosToCaretAndTopLine(CleanPos: integer;
|
||||||
var Caret:TCodeXYPosition; var NewTopLine: integer): boolean; // true=ok, false=invalid CleanPos
|
var Caret:TCodeXYPosition; var NewTopLine: integer): boolean; // true=ok, false=invalid CleanPos
|
||||||
|
procedure GetCleanPosInfo(CodePosInFront, CleanPos: integer;
|
||||||
|
ResolveComments: boolean; var SameArea: TAtomPosition);
|
||||||
procedure GetLineInfo(ACleanPos: integer;
|
procedure GetLineInfo(ACleanPos: integer;
|
||||||
var ALineStart, ALineEnd, AFirstAtomStart, ALastAtomEnd: integer);
|
var ALineStart, ALineEnd, AFirstAtomStart, ALastAtomEnd: integer);
|
||||||
function FindLineEndOrCodeAfterPosition(StartPos: integer): integer;
|
function FindLineEndOrCodeAfterPosition(StartPos: integer): integer;
|
||||||
@ -171,6 +172,7 @@ type
|
|||||||
function IsPCharInSrc(ACleanPos: PChar): boolean;
|
function IsPCharInSrc(ACleanPos: PChar): boolean;
|
||||||
function ReadTilBracketClose(ExceptionOnNotFound: boolean): boolean;
|
function ReadTilBracketClose(ExceptionOnNotFound: boolean): boolean;
|
||||||
function ReadBackTilBracketOpen(ExceptionOnNotFound: boolean): boolean;
|
function ReadBackTilBracketOpen(ExceptionOnNotFound: boolean): boolean;
|
||||||
|
procedure ReadTillCommentEnd;
|
||||||
function DoAtom: boolean; virtual;
|
function DoAtom: boolean; virtual;
|
||||||
procedure ReadNextAtom;
|
procedure ReadNextAtom;
|
||||||
procedure UndoReadNextAtom;
|
procedure UndoReadNextAtom;
|
||||||
@ -665,11 +667,7 @@ begin
|
|||||||
{$R-}
|
{$R-}
|
||||||
if (CurPos.StartPos<CurPos.EndPos) then
|
if (CurPos.StartPos<CurPos.EndPos) then
|
||||||
LastAtoms.Add(CurPos);
|
LastAtoms.Add(CurPos);
|
||||||
if NextPos.StartPos>=1 then begin
|
if NextPos.StartPos<1 then begin
|
||||||
CurPos:=NextPos;
|
|
||||||
NextPos.StartPos:=-1;
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
CurPos.StartPos:=CurPos.EndPos;
|
CurPos.StartPos:=CurPos.EndPos;
|
||||||
CurPos.Flag:=cafNone;
|
CurPos.Flag:=cafNone;
|
||||||
if CurPos.StartPos>SrcLen then
|
if CurPos.StartPos>SrcLen then
|
||||||
@ -689,21 +687,26 @@ begin
|
|||||||
begin
|
begin
|
||||||
CommentLvl:=1;
|
CommentLvl:=1;
|
||||||
inc(CurPos.StartPos);
|
inc(CurPos.StartPos);
|
||||||
while (CurPos.StartPos<=SrcLen) and (CommentLvl>0) do begin
|
while true do begin
|
||||||
case Src[CurPos.StartPos] of
|
case Src[CurPos.StartPos] of
|
||||||
|
#0: if CurPos.StartPos>SrcLen then break;
|
||||||
'{': if Scanner.NestedComments then inc(CommentLvl);
|
'{': if Scanner.NestedComments then inc(CommentLvl);
|
||||||
'}': dec(CommentLvl);
|
'}':
|
||||||
|
begin
|
||||||
|
dec(CommentLvl);
|
||||||
|
if CommentLvl=0 then break;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
inc(CurPos.StartPos);
|
inc(CurPos.StartPos);
|
||||||
end;
|
end;
|
||||||
|
inc(CurPos.StartPos);
|
||||||
end;
|
end;
|
||||||
'/': // Delphi comment
|
'/': // Delphi comment
|
||||||
if (Src[CurPos.StartPos+1]<>'/') then begin
|
if (Src[CurPos.StartPos+1]<>'/') then begin
|
||||||
break;
|
break;
|
||||||
end else begin
|
end else begin
|
||||||
inc(CurPos.StartPos,2);
|
inc(CurPos.StartPos,2);
|
||||||
while (CurPos.StartPos<=SrcLen)
|
while (not (Src[CurPos.StartPos] in [#10,#13,#0])) do
|
||||||
and (not (Src[CurPos.StartPos] in [#10,#13])) do
|
|
||||||
inc(CurPos.StartPos);
|
inc(CurPos.StartPos);
|
||||||
inc(CurPos.StartPos);
|
inc(CurPos.StartPos);
|
||||||
if (CurPos.StartPos<=SrcLen) and (Src[CurPos.StartPos] in [#10,#13])
|
if (CurPos.StartPos<=SrcLen) and (Src[CurPos.StartPos] in [#10,#13])
|
||||||
@ -725,11 +728,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
CurPos.EndPos:=CurPos.StartPos;
|
CurPos.EndPos:=CurPos.StartPos;
|
||||||
if CurPos.StartPos>SrcLen then
|
|
||||||
exit;
|
|
||||||
// read atom
|
// read atom
|
||||||
c1:=UpperSrc[CurPos.EndPos];
|
c1:=UpperSrc[CurPos.EndPos];
|
||||||
case c1 of
|
case c1 of
|
||||||
|
#0: ;
|
||||||
'_','A'..'Z':
|
'_','A'..'Z':
|
||||||
begin
|
begin
|
||||||
inc(CurPos.EndPos);
|
inc(CurPos.EndPos);
|
||||||
@ -906,11 +908,17 @@ begin
|
|||||||
or ((c1='*') and (c2='*'))
|
or ((c1='*') and (c2='*'))
|
||||||
then inc(CurPos.EndPos);
|
then inc(CurPos.EndPos);
|
||||||
if ((c1='@') and (c2='@')) then begin
|
if ((c1='@') and (c2='@')) then begin
|
||||||
|
// @@ label
|
||||||
repeat
|
repeat
|
||||||
inc(CurPos.EndPos);
|
inc(CurPos.EndPos);
|
||||||
until (CurPos.EndPos>SrcLen) or (not IsIdentChar[Src[CurPos.EndPos]]);
|
until (CurPos.EndPos>SrcLen) or (not IsIdentChar[Src[CurPos.EndPos]]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end else begin
|
||||||
|
CurPos:=NextPos;
|
||||||
|
NextPos.StartPos:=-1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
{$IFDEF RangeChecking}{$R+}{$ENDIF}
|
{$IFDEF RangeChecking}{$R+}{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1389,6 +1397,53 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomCodeTool.ReadTillCommentEnd;
|
||||||
|
var
|
||||||
|
CommentLvl: Integer;
|
||||||
|
begin
|
||||||
|
{$IFOPT R+}{$DEFINE RangeChecking}{$ENDIF}
|
||||||
|
{$R-}
|
||||||
|
case Src[CurPos.StartPos] of
|
||||||
|
'{': // pascal comment
|
||||||
|
begin
|
||||||
|
CommentLvl:=1;
|
||||||
|
inc(CurPos.StartPos);
|
||||||
|
while true do begin
|
||||||
|
case Src[CurPos.StartPos] of
|
||||||
|
#0: if CurPos.StartPos>SrcLen then break;
|
||||||
|
'{': if Scanner.NestedComments then inc(CommentLvl);
|
||||||
|
'}':
|
||||||
|
begin
|
||||||
|
dec(CommentLvl);
|
||||||
|
if CommentLvl=0 then break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
inc(CurPos.StartPos);
|
||||||
|
end;
|
||||||
|
inc(CurPos.StartPos);
|
||||||
|
end;
|
||||||
|
'/': // Delphi comment
|
||||||
|
if (Src[CurPos.StartPos+1]='/') then begin
|
||||||
|
inc(CurPos.StartPos,2);
|
||||||
|
while (not (Src[CurPos.StartPos] in [#10,#13,#0])) do
|
||||||
|
inc(CurPos.StartPos);
|
||||||
|
inc(CurPos.StartPos);
|
||||||
|
if (CurPos.StartPos<=SrcLen) and (Src[CurPos.StartPos] in [#10,#13])
|
||||||
|
and (Src[CurPos.StartPos-1]<>Src[CurPos.StartPos]) then
|
||||||
|
inc(CurPos.StartPos);
|
||||||
|
end;
|
||||||
|
'(': // old turbo pascal comment
|
||||||
|
if (Src[CurPos.StartPos+1]='*') then begin
|
||||||
|
inc(CurPos.StartPos,3);
|
||||||
|
while (CurPos.StartPos<=SrcLen)
|
||||||
|
and ((Src[CurPos.StartPos-1]<>'*') or (Src[CurPos.StartPos]<>')')) do
|
||||||
|
inc(CurPos.StartPos);
|
||||||
|
inc(CurPos.StartPos);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$IFDEF RangeChecking}{$R+}{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomCodeTool.BeginParsing(DeleteNodes,
|
procedure TCustomCodeTool.BeginParsing(DeleteNodes,
|
||||||
OnlyInterfaceNeeded: boolean);
|
OnlyInterfaceNeeded: boolean);
|
||||||
begin
|
begin
|
||||||
@ -1806,6 +1861,71 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomCodeTool.GetCleanPosInfo(CodePosInFront, CleanPos: integer;
|
||||||
|
ResolveComments: boolean; var SameArea: TAtomPosition);
|
||||||
|
var
|
||||||
|
ANode: TCodeTreeNode;
|
||||||
|
begin
|
||||||
|
if CodePosInFront<1 then begin
|
||||||
|
ANode:=FindDeepestNodeAtPos(CleanPos,True);
|
||||||
|
CodePosInFront:=ANode.StartPos;
|
||||||
|
end;
|
||||||
|
MoveCursorToCleanPos(CodePosInFront);
|
||||||
|
repeat
|
||||||
|
ReadNextAtom;
|
||||||
|
if (CleanPos>=CurPos.StartPos) and (CleanPos<CurPos.EndPos) then begin
|
||||||
|
// clean pos on token
|
||||||
|
SameArea:=CurPos;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if CleanPos<CurPos.StartPos then begin
|
||||||
|
// clean pos between tokens
|
||||||
|
SameArea.Flag:=cafNone;
|
||||||
|
// get range of space behind last atom
|
||||||
|
if LastAtoms.Count>0 then begin
|
||||||
|
SameArea.StartPos:=LastAtoms.GetValueAt(0).EndPos;
|
||||||
|
end else begin
|
||||||
|
SameArea.StartPos:=CodePosInFront;
|
||||||
|
end;
|
||||||
|
SameArea.EndPos:=SameArea.StartPos;
|
||||||
|
repeat
|
||||||
|
while (SameArea.EndPos<=SrcLen)
|
||||||
|
and (IsSpaceChar[Src[SameArea.EndPos]]) do
|
||||||
|
inc(SameArea.EndPos);
|
||||||
|
if (SameArea.EndPos>CleanPos) or (SameArea.EndPos>SrcLen) then begin
|
||||||
|
// cursor is in normal space (i.e. not comment)
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
// still between the two tokens, but end of space
|
||||||
|
// -> here starts a comment
|
||||||
|
SameArea.StartPos:=SameArea.EndPos;
|
||||||
|
MoveCursorToCleanPos(SameArea.StartPos);
|
||||||
|
ReadTillCommentEnd;
|
||||||
|
SameArea.EndPos:=CurPos.EndPos;
|
||||||
|
if (SameArea.StartPos=SameArea.EndPos) then
|
||||||
|
RaiseException('TCustomCodeTool.GetCleanPosInfo Internal Error A');
|
||||||
|
if CleanPos<SameArea.EndPos then begin
|
||||||
|
// cursor is in comment
|
||||||
|
if ResolveComments then begin
|
||||||
|
// take comment as normal code and search again
|
||||||
|
CodePosInFront:=SameArea.StartPos;
|
||||||
|
case Src[CodePosInFront] of
|
||||||
|
'{': inc(CodePosInFront);
|
||||||
|
'(','/': inc(CodePosInFront,2);
|
||||||
|
else
|
||||||
|
RaiseException('TCustomCodeTool.GetCleanPosInfo Internal Error B');
|
||||||
|
end;
|
||||||
|
GetCleanPosInfo(CodePosInFront,CleanPos,true,SameArea);
|
||||||
|
end;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
SameArea.StartPos:=SameArea.EndPos;
|
||||||
|
until false;
|
||||||
|
end;
|
||||||
|
until (CurPos.Flag=cafNone) or (CurPos.EndPos>CleanPos);
|
||||||
|
SameArea:=CurPos;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomCodeTool.GetLineInfo(ACleanPos: integer;
|
procedure TCustomCodeTool.GetLineInfo(ACleanPos: integer;
|
||||||
var ALineStart, ALineEnd, AFirstAtomStart, ALastAtomEnd: integer);
|
var ALineStart, ALineEnd, AFirstAtomStart, ALastAtomEnd: integer);
|
||||||
begin
|
begin
|
||||||
|
@ -196,6 +196,7 @@ type
|
|||||||
procedure BuildSubTreeForProcHead(ProcNode: TCodeTreeNode); virtual;
|
procedure BuildSubTreeForProcHead(ProcNode: TCodeTreeNode); virtual;
|
||||||
procedure BuildSubTreeForProcHead(ProcNode: TCodeTreeNode;
|
procedure BuildSubTreeForProcHead(ProcNode: TCodeTreeNode;
|
||||||
var FunctionResult: TCodeTreeNode);
|
var FunctionResult: TCodeTreeNode);
|
||||||
|
procedure BuildSubTree(CleanCursorPos: integer); virtual;
|
||||||
|
|
||||||
function DoAtom: boolean; override;
|
function DoAtom: boolean; override;
|
||||||
|
|
||||||
@ -3927,15 +3928,20 @@ begin
|
|||||||
RaiseLastError;
|
RaiseLastError;
|
||||||
// check if cursor is in interface
|
// check if cursor is in interface
|
||||||
Dummy:=CaretToCleanPos(CursorPos, CleanCursorPos);
|
Dummy:=CaretToCleanPos(CursorPos, CleanCursorPos);
|
||||||
if (Dummy=0) or (Dummy=-1) then
|
if (Dummy=0) or (Dummy=-1) then begin
|
||||||
|
BuildSubTree(CleanCursorPos);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
BuildTree(TreeRange=trInterface);
|
BuildTree(TreeRange=trInterface);
|
||||||
if (not IgnoreErrorAfterValid) and (not EndOfSourceFound) then
|
if (not IgnoreErrorAfterValid) and (not EndOfSourceFound) then
|
||||||
SaveRaiseException(ctsEndOfSourceNotFound);
|
SaveRaiseException(ctsEndOfSourceNotFound);
|
||||||
// find the CursorPos in cleaned source
|
// find the CursorPos in cleaned source
|
||||||
Dummy:=CaretToCleanPos(CursorPos, CleanCursorPos);
|
Dummy:=CaretToCleanPos(CursorPos, CleanCursorPos);
|
||||||
if (Dummy<>0) and (Dummy<>-1) then
|
if (Dummy=0) or (Dummy=-1) then begin
|
||||||
|
BuildSubTree(CleanCursorPos);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
RaiseException(ctsCursorPosOutsideOfCode);
|
RaiseException(ctsCursorPosOutsideOfCode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -4276,6 +4282,21 @@ begin
|
|||||||
FunctionResult:=FunctionResult.NextBrother;
|
FunctionResult:=FunctionResult.NextBrother;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPascalParserTool.BuildSubTree(CleanCursorPos: integer);
|
||||||
|
var
|
||||||
|
ANode: TCodeTreeNode;
|
||||||
|
begin
|
||||||
|
ANode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
||||||
|
case ANode.Desc of
|
||||||
|
ctnClass,ctnClassInterface:
|
||||||
|
BuildSubTreeForClass(ANode);
|
||||||
|
ctnProcedure,ctnProcedureHead:
|
||||||
|
BuildSubTreeForProcHead(ANode);
|
||||||
|
ctnBeginBlock:
|
||||||
|
BuildSubTreeForBeginBlock(ANode);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -57,10 +57,6 @@ type
|
|||||||
function ReadForwardTilAnyBracketClose: boolean;
|
function ReadForwardTilAnyBracketClose: boolean;
|
||||||
function ReadBackwardTilAnyBracketClose: boolean;
|
function ReadBackwardTilAnyBracketClose: boolean;
|
||||||
public
|
public
|
||||||
// search & replace
|
|
||||||
function ReplaceIdentifiers(IdentList: TStrings;
|
|
||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
|
||||||
|
|
||||||
// source name e.g. 'unit UnitName;'
|
// source name e.g. 'unit UnitName;'
|
||||||
function GetSourceNamePos(var NamePos: TAtomPosition): boolean;
|
function GetSourceNamePos(var NamePos: TAtomPosition): boolean;
|
||||||
function GetSourceName: string;
|
function GetSourceName: string;
|
||||||
@ -155,6 +151,14 @@ type
|
|||||||
var NewPos: TCodeXYPosition; var NewTopLine: integer): boolean;
|
var NewPos: TCodeXYPosition; var NewTopLine: integer): boolean;
|
||||||
function FindEnclosingIncludeDirective(CursorPos: TCodeXYPosition;
|
function FindEnclosingIncludeDirective(CursorPos: TCodeXYPosition;
|
||||||
var NewPos: TCodeXYPosition; var NewTopLine: integer): boolean;
|
var NewPos: TCodeXYPosition; var NewTopLine: integer): boolean;
|
||||||
|
|
||||||
|
// search & replace
|
||||||
|
function ReplaceIdentifiers(IdentList: TStrings;
|
||||||
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
|
|
||||||
|
// expressions
|
||||||
|
function GetExpressionBounds(CursorPos: TCodeXYPosition;
|
||||||
|
var StartPos, EndPos: TCodeXYPosition): boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1180,6 +1184,20 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TStandardCodeTool.GetExpressionBounds(CursorPos: TCodeXYPosition;
|
||||||
|
var StartPos, EndPos: TCodeXYPosition): boolean;
|
||||||
|
var
|
||||||
|
CleanCursorPos: integer;
|
||||||
|
CursorNode: TCodeTreeNode;
|
||||||
|
begin
|
||||||
|
Result:=false;
|
||||||
|
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[]);
|
||||||
|
CursorNode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
||||||
|
MoveCursorToNodeStart(CursorNode);
|
||||||
|
ReadNextAtom;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
function TStandardCodeTool.FindPublishedVariable(const UpperClassName,
|
function TStandardCodeTool.FindPublishedVariable(const UpperClassName,
|
||||||
UpperVarName: string): TCodeTreeNode;
|
UpperVarName: string): TCodeTreeNode;
|
||||||
var ClassNode, SectionNode: TCodeTreeNode;
|
var ClassNode, SectionNode: TCodeTreeNode;
|
||||||
|
Loading…
Reference in New Issue
Block a user