mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 09:59:23 +02:00
codetools: fixed TCustomCodeTool.ReadBackTilBracketOpen when there is no bracket
git-svn-id: trunk@43378 -
This commit is contained in:
parent
3163c7673e
commit
6123660445
@ -1954,25 +1954,25 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Start:=CurPos;
|
Start:=CurPos;
|
||||||
repeat
|
while CurPos.StartPos>1 do begin
|
||||||
ReadPriorAtom;
|
ReadPriorAtom;
|
||||||
if (CurPos.Flag=OpenBracket) then break;
|
if (CurPos.Flag=OpenBracket) then exit(true);
|
||||||
if (CurPos.StartPos<1)
|
if (CurPos.StartPos<1)
|
||||||
or (CurPos.Flag in [AntiOpenBracket,cafEND])
|
or (CurPos.Flag in [AntiOpenBracket,cafEND])
|
||||||
or ((CurPos.Flag=cafWord)
|
or ((CurPos.Flag=cafWord)
|
||||||
and UnexpectedKeyWordInBrackets.DoItCaseInsensitive(Src,
|
and UnexpectedKeyWordInBrackets.DoItCaseInsensitive(Src,
|
||||||
CurPos.StartPos,CurPos.EndPos-CurPos.StartPos))
|
CurPos.StartPos,CurPos.EndPos-CurPos.StartPos))
|
||||||
then begin
|
then begin
|
||||||
CurPos:=Start;
|
break;
|
||||||
if ExceptionOnNotFound then
|
|
||||||
RaiseBracketNotFound;
|
|
||||||
exit;
|
|
||||||
end;
|
end;
|
||||||
if CurPos.Flag in [cafRoundBracketClose,cafEdgedBracketClose] then begin
|
if CurPos.Flag in [cafRoundBracketClose,cafEdgedBracketClose] then begin
|
||||||
if not ReadBackTilBracketOpen(ExceptionOnNotFound) then exit;
|
if not ReadBackTilBracketOpen(ExceptionOnNotFound) then exit;
|
||||||
end;
|
end;
|
||||||
until false;
|
end;
|
||||||
Result:=true;
|
CurPos:=Start;
|
||||||
|
if ExceptionOnNotFound then
|
||||||
|
RaiseBracketNotFound;
|
||||||
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomCodeTool.ReadTillCommentEnd;
|
procedure TCustomCodeTool.ReadTillCommentEnd;
|
||||||
|
Loading…
Reference in New Issue
Block a user