mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 06:19:32 +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);
|
procedure ReadStringConstantBackward(var p: integer);
|
||||||
var
|
var
|
||||||
PrePos: integer;
|
PrePos: integer;
|
||||||
|
StartPos: LongInt;
|
||||||
begin
|
begin
|
||||||
|
StartPos:=p;
|
||||||
while (p>1) do begin
|
while (p>1) do begin
|
||||||
case Source[p-1] of
|
case Source[p-1] of
|
||||||
'''':
|
'''':
|
||||||
@ -2086,6 +2088,8 @@ function FindStartOfAtom(const Source: string; Position: integer): integer;
|
|||||||
repeat
|
repeat
|
||||||
dec(PrePos);
|
dec(PrePos);
|
||||||
if (PrePos<1) or (Source[PrePos] in [#10,#13]) then begin
|
if (PrePos<1) or (Source[PrePos] in [#10,#13]) then begin
|
||||||
|
// the StartPos was the start of a string constant
|
||||||
|
p:=StartPos-1;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
until (Source[PrePos]='''');
|
until (Source[PrePos]='''');
|
||||||
@ -2158,6 +2162,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
'''':
|
'''':
|
||||||
begin
|
begin
|
||||||
|
// could be start or end
|
||||||
inc(Result);
|
inc(Result);
|
||||||
ReadStringConstantBackward(Result);
|
ReadStringConstantBackward(Result);
|
||||||
end;
|
end;
|
||||||
|
@ -8127,6 +8127,7 @@ function TFindDeclarationTool.GetCurrentAtomType: TVariableAtomType;
|
|||||||
var
|
var
|
||||||
Node: TCodeTreeNode;
|
Node: TCodeTreeNode;
|
||||||
begin
|
begin
|
||||||
|
//debugln(['TFindDeclarationTool.GetCurrentAtomType ',CurPos.StartPos,' ',CurPos.EndPos,' ',SrcLen,' ',GetAtom]);
|
||||||
if (CurPos.StartPos=CurPos.EndPos) then
|
if (CurPos.StartPos=CurPos.EndPos) then
|
||||||
Result:=vatSpace
|
Result:=vatSpace
|
||||||
else if (CurPos.StartPos>SrcLen) then
|
else if (CurPos.StartPos>SrcLen) then
|
||||||
|
Loading…
Reference in New Issue
Block a user