codetools: completeblock test result

git-svn-id: trunk@21336 -
This commit is contained in:
mattias 2009-08-19 21:49:25 +00:00
parent 2c2fb53b25
commit 4a05e3f8e0
3 changed files with 27 additions and 8 deletions

1
.gitattributes vendored
View File

@ -168,6 +168,7 @@ components/codetools/examples/testscompleteblock/caseend1.inc svneol=native#text
components/codetools/examples/testscompleteblock/class1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/ifbegin1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/ifbeginelse1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/ifbeginelse1_result.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/procedurebegin1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/procedurebeginend1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/procedurebeginifbegin1.inc svneol=native#text/plain

View File

@ -45,7 +45,7 @@ begin
Defines:=TStringList.Create;
try
if Paramcount>0 then begin
if Paramcount<>4 then begin
if Paramcount<4 then begin
writeln('Usage: '+ParamStrUTF8(0)+' filename line column define1 define2');
exit;
end;
@ -79,17 +79,21 @@ begin
end;
CodeToolBoss.DefineTree.Add(DirDef);
writeln('StartFile=',Code.Filename);
writeln('StartX=',X);
writeln('StartY=',Y);
if Defines.IndexOf('fpcunit')<0 then begin
writeln('StartFile=',Code.Filename);
writeln('StartX=',X);
writeln('StartY=',Y);
end;
if not CodeToolBoss.CompleteBlock(Code,X,Y,NewCode,NewX,NewY,NewTopLine) then begin
writeln('ERROR: complete block failed at ',Code.Filename,' X=',X,' Y=',Y);
exit;
end;
writeln('File=',NewCode.Filename);
writeln('X=',NewX);
writeln('Y=',NewY);
writeln('TopLine=',NewTopLine);
if Defines.IndexOf('fpcunit')<0 then begin
writeln('File=',NewCode.Filename);
writeln('X=',NewX);
writeln('Y=',NewY);
writeln('TopLine=',NewTopLine);
end;
writeln(NewCode.Source);
finally
Defines.Free;

View File

@ -0,0 +1,14 @@
{%MainUnit unit1.pas}
procedure Do1;
begin
if True then
begin
Test() //caret position
end
else
begin
end;
end;