mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 17:16:01 +02:00
codetools: FindStartOfTerm: check next atom
git-svn-id: trunk@22361 -
This commit is contained in:
parent
cdabdbc280
commit
4483337f54
@ -5914,7 +5914,8 @@ function TFindDeclarationTool.FindStartOfTerm(EndPos: integer; InType: boolean
|
|||||||
7. (A).
|
7. (A).
|
||||||
8. (A as B)
|
8. (A as B)
|
||||||
9. (@A)
|
9. (@A)
|
||||||
10. nothing (e.g. cursor behind semicolon, keyword or closing bracket)
|
10. A()[]
|
||||||
|
11. nothing (e.g. cursor behind semicolon, keyword or closing bracket)
|
||||||
}
|
}
|
||||||
procedure RaiseIdentNotFound;
|
procedure RaiseIdentNotFound;
|
||||||
begin
|
begin
|
||||||
@ -5923,17 +5924,28 @@ function TFindDeclarationTool.FindStartOfTerm(EndPos: integer; InType: boolean
|
|||||||
|
|
||||||
var CurAtom, NextAtom: TAtomPosition;
|
var CurAtom, NextAtom: TAtomPosition;
|
||||||
NextAtomType, CurAtomType: TVariableAtomType;
|
NextAtomType, CurAtomType: TVariableAtomType;
|
||||||
|
StartPos: LongInt;
|
||||||
begin
|
begin
|
||||||
MoveCursorToCleanPos(FindStartOfAtom(Src,EndPos));
|
StartPos:=FindStartOfAtom(Src,EndPos);
|
||||||
|
MoveCursorToCleanPos(StartPos);
|
||||||
NextAtom:=CurPos;
|
NextAtom:=CurPos;
|
||||||
NextAtomType:=vatSpace;
|
ReadNextAtom;
|
||||||
|
NextAtomType:=GetCurrentAtomType;
|
||||||
repeat
|
repeat
|
||||||
ReadPriorAtom;
|
ReadPriorAtom;
|
||||||
CurAtom:=CurPos;
|
CurAtom:=CurPos;
|
||||||
CurAtomType:=GetCurrentAtomType;
|
CurAtomType:=GetCurrentAtomType;
|
||||||
if CurAtomType in [vatRoundBracketClose,vatEdgedBracketClose] then begin
|
if CurAtomType in [vatRoundBracketClose,vatEdgedBracketClose] then begin
|
||||||
ReadBackTilBracketOpen(true);
|
if NextAtomType in [vatRoundBracketOpen,vatRoundBracketClose,
|
||||||
CurAtom.StartPos:=CurPos.StartPos;
|
vatEdgedBracketOpen,vatEdgedBracketClose,vatPoint,vatUp,
|
||||||
|
vatAS,vatNone,vatSpace]
|
||||||
|
then begin
|
||||||
|
ReadBackTilBracketOpen(true);
|
||||||
|
CurAtom.StartPos:=CurPos.StartPos;
|
||||||
|
end else begin
|
||||||
|
Result:=NextAtom.StartPos;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
// check if CurAtom belongs to variable
|
// check if CurAtom belongs to variable
|
||||||
if CurAtomType=vatINHERITED then begin
|
if CurAtomType=vatINHERITED then begin
|
||||||
|
Loading…
Reference in New Issue
Block a user