mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 06:26:07 +02:00
fixed guess unclosed block for identifier = class ();
git-svn-id: trunk@8005 -
This commit is contained in:
parent
88a48665d5
commit
c3ae0b99dc
@ -815,7 +815,11 @@ begin
|
||||
while true do begin
|
||||
case Src[CurPos.StartPos] of
|
||||
#0: if CurPos.StartPos>SrcLen then break;
|
||||
'{': if Scanner.NestedComments then inc(CommentLvl);
|
||||
'{': if Scanner.NestedComments then
|
||||
begin
|
||||
//debugln('TCustomCodeTool.ReadNextAtom ',copy(Src,CurPos.StartPos,CurPos.StartPos-CurPos.EndPos));
|
||||
inc(CommentLvl);
|
||||
end;
|
||||
'}':
|
||||
begin
|
||||
dec(CommentLvl);
|
||||
|
@ -511,7 +511,7 @@ begin
|
||||
if UpAtomIs('USES') then
|
||||
ReadUsesSection(true);
|
||||
repeat
|
||||
//DebugLn('[TPascalParserTool.BuildTree] ALL '+GetAtom);
|
||||
//DebugLn('[TPascalParserTool.BuildTree] ALL ',GetAtom);
|
||||
if not DoAtom then break;
|
||||
if CurSection=ctnNone then begin
|
||||
EndOfSourceFound:=true;
|
||||
|
@ -4214,17 +4214,42 @@ begin
|
||||
bkwClass, bkwObject, bkwInterface, bkwDispInterface:
|
||||
begin
|
||||
ReadNextAtom;
|
||||
if AtomIsChar(';')
|
||||
or ((CurBlockWord=bkwClass) and UpAtomIs('OF'))
|
||||
if AtomIsChar(';') // forward class
|
||||
or ((CurBlockWord=bkwClass) and UpAtomIs('OF')) // 'class of'
|
||||
or ((CurBlockWord=bkwClass)
|
||||
and (UpAtomIs('FUNCTION') or UpAtomIs('PROCEDURE')))
|
||||
and (UpAtomIs('FUNCTION') or UpAtomIs('PROCEDURE'))) // 'class procedure'
|
||||
or ((CurBlockWord=bkwObject) and LastUpAtomIs(0,'OF')) then
|
||||
begin
|
||||
// forward class or 'class of' or class method or 'of object'
|
||||
end else begin
|
||||
UndoReadNextAtom;
|
||||
BlockType:=CurBlockWord;
|
||||
BlockStart:=CurPos.StartPos;
|
||||
// read ancestor list class(...)
|
||||
if CurPos.Flag=cafRoundBracketOpen then begin
|
||||
repeat
|
||||
ReadNextAtom;
|
||||
if AtomIsIdentifier(false) then begin
|
||||
ReadNextAtom;
|
||||
if CurPos.Flag=cafPoint then begin
|
||||
ReadNextAtom;
|
||||
AtomIsIdentifier(true);
|
||||
end;
|
||||
end;
|
||||
if CurPos.Flag=cafRoundBracketClose then break;
|
||||
if CurPos.Flag<>cafComma then begin
|
||||
exit(false);
|
||||
end;
|
||||
until false;
|
||||
end;
|
||||
ReadNextAtom;
|
||||
// a semicolon directly behind the ancestor list ends the class
|
||||
if (CurPos.Flag in [cafEnd,cafSemicolon]) then begin
|
||||
// class ends
|
||||
BlockType:=bkwNone;
|
||||
end else begin
|
||||
// class continues
|
||||
UndoReadNextAtom;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -10541,8 +10541,12 @@ begin
|
||||
begin
|
||||
DoJumpToCodePos(ActiveSrcEdit, ActiveUnitInfo,
|
||||
NewSource, NewX, NewY, NewTopLine, true);
|
||||
end else
|
||||
DoJumpToCodeToolBossError;
|
||||
end else begin
|
||||
if CodeToolBoss.ErrorMessage='' then begin
|
||||
MessageDlg('Success','All blocks looks ok.',mtInformation,[mbOk],0);
|
||||
end else
|
||||
DoJumpToCodeToolBossError;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.DoJumpToGuessedMisplacedIFDEF(FindNext: boolean);
|
||||
|
Loading…
Reference in New Issue
Block a user