codetools: complete block: begin begin begin end end

git-svn-id: trunk@20457 -
This commit is contained in:
mattias 2009-06-05 18:13:48 +00:00
parent 6bf2f76a84
commit 8209691967
2 changed files with 5 additions and 3 deletions

View File

@ -381,8 +381,9 @@ var
if (Stack.Top>=0) then begin
ParentBlock:=@Stack.Stack[Stack.Top];
if (ParentBlock^.InnerStartPos=AtomStart)
and (Policies<>nil) then
and (Policies<>nil) then begin
Policies.AddIndent(ParentBlock^.Typ,Typ,ParentBlock^.InnerIdent);
end;
end;
Stack.BeginBlock(Typ,AtomStart);
{$IFDEF ShowCodeBeautifierParser}

View File

@ -5316,6 +5316,7 @@ var
NeedCompletion:=false;
repeat
ReadNextAtom;
if CurPos.StartPos>=StartNode.EndPos then break;
//DebugLn(['ReadStatements Atom=',GetAtom,' TopTyp=',ord(TopBlockType(Stack)),' Top=',Stack.Top]);
if (Stack.Top>=0) and (Stack.Stack[Stack.Top].InnerIndent<0)
@ -5713,8 +5714,8 @@ begin
//DebugLn(['TStandardCodeTool.CompleteBlock ',StartNode.DescAsString]);
if StartNode.Desc in AllPascalStatements then begin
if (StartNode.Parent<>nil)
and (StartNode.Parent.Desc in AllPascalStatements) then
while (StartNode.Parent<>nil)
and (StartNode.Parent.Desc in AllPascalStatements) do
StartNode:=StartNode.Parent;
if not CompleteStatements(Stack) then exit;
end;