mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 17:16:01 +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
|
while true do begin
|
||||||
case Src[CurPos.StartPos] of
|
case Src[CurPos.StartPos] of
|
||||||
#0: if CurPos.StartPos>SrcLen then break;
|
#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
|
begin
|
||||||
dec(CommentLvl);
|
dec(CommentLvl);
|
||||||
|
@ -511,7 +511,7 @@ begin
|
|||||||
if UpAtomIs('USES') then
|
if UpAtomIs('USES') then
|
||||||
ReadUsesSection(true);
|
ReadUsesSection(true);
|
||||||
repeat
|
repeat
|
||||||
//DebugLn('[TPascalParserTool.BuildTree] ALL '+GetAtom);
|
//DebugLn('[TPascalParserTool.BuildTree] ALL ',GetAtom);
|
||||||
if not DoAtom then break;
|
if not DoAtom then break;
|
||||||
if CurSection=ctnNone then begin
|
if CurSection=ctnNone then begin
|
||||||
EndOfSourceFound:=true;
|
EndOfSourceFound:=true;
|
||||||
|
@ -4214,17 +4214,42 @@ begin
|
|||||||
bkwClass, bkwObject, bkwInterface, bkwDispInterface:
|
bkwClass, bkwObject, bkwInterface, bkwDispInterface:
|
||||||
begin
|
begin
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
if AtomIsChar(';')
|
if AtomIsChar(';') // forward class
|
||||||
or ((CurBlockWord=bkwClass) and UpAtomIs('OF'))
|
or ((CurBlockWord=bkwClass) and UpAtomIs('OF')) // 'class of'
|
||||||
or ((CurBlockWord=bkwClass)
|
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
|
or ((CurBlockWord=bkwObject) and LastUpAtomIs(0,'OF')) then
|
||||||
begin
|
begin
|
||||||
// forward class or 'class of' or class method or 'of object'
|
// forward class or 'class of' or class method or 'of object'
|
||||||
end else begin
|
end else begin
|
||||||
UndoReadNextAtom;
|
|
||||||
BlockType:=CurBlockWord;
|
BlockType:=CurBlockWord;
|
||||||
BlockStart:=CurPos.StartPos;
|
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;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -10541,8 +10541,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
DoJumpToCodePos(ActiveSrcEdit, ActiveUnitInfo,
|
DoJumpToCodePos(ActiveSrcEdit, ActiveUnitInfo,
|
||||||
NewSource, NewX, NewY, NewTopLine, true);
|
NewSource, NewX, NewY, NewTopLine, true);
|
||||||
end else
|
end else begin
|
||||||
DoJumpToCodeToolBossError;
|
if CodeToolBoss.ErrorMessage='' then begin
|
||||||
|
MessageDlg('Success','All blocks looks ok.',mtInformation,[mbOk],0);
|
||||||
|
end else
|
||||||
|
DoJumpToCodeToolBossError;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.DoJumpToGuessedMisplacedIFDEF(FindNext: boolean);
|
procedure TMainIDE.DoJumpToGuessedMisplacedIFDEF(FindNext: boolean);
|
||||||
|
Loading…
Reference in New Issue
Block a user