mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 13:09:20 +02:00
codetools: fixed FindStartOFindStartOfAtomfAtom if at start of string constant
git-svn-id: trunk@27688 -
This commit is contained in:
parent
ce82f81416
commit
ef525bda22
@ -2076,7 +2076,9 @@ function FindStartOfAtom(const Source: string; Position: integer): integer;
|
||||
procedure ReadStringConstantBackward(var p: integer);
|
||||
var
|
||||
PrePos: integer;
|
||||
StartPos: LongInt;
|
||||
begin
|
||||
StartPos:=p;
|
||||
while (p>1) do begin
|
||||
case Source[p-1] of
|
||||
'''':
|
||||
@ -2086,6 +2088,8 @@ function FindStartOfAtom(const Source: string; Position: integer): integer;
|
||||
repeat
|
||||
dec(PrePos);
|
||||
if (PrePos<1) or (Source[PrePos] in [#10,#13]) then begin
|
||||
// the StartPos was the start of a string constant
|
||||
p:=StartPos-1;
|
||||
exit;
|
||||
end;
|
||||
until (Source[PrePos]='''');
|
||||
@ -2158,6 +2162,7 @@ begin
|
||||
end;
|
||||
'''':
|
||||
begin
|
||||
// could be start or end
|
||||
inc(Result);
|
||||
ReadStringConstantBackward(Result);
|
||||
end;
|
||||
|
@ -8127,6 +8127,7 @@ function TFindDeclarationTool.GetCurrentAtomType: TVariableAtomType;
|
||||
var
|
||||
Node: TCodeTreeNode;
|
||||
begin
|
||||
//debugln(['TFindDeclarationTool.GetCurrentAtomType ',CurPos.StartPos,' ',CurPos.EndPos,' ',SrcLen,' ',GetAtom]);
|
||||
if (CurPos.StartPos=CurPos.EndPos) then
|
||||
Result:=vatSpace
|
||||
else if (CurPos.StartPos>SrcLen) then
|
||||
|
Loading…
Reference in New Issue
Block a user