codetools: parse initialization with with statements

git-svn-id: trunk@34956 -
This commit is contained in:
mattias 2012-01-26 15:19:57 +00:00
parent cd6db590b3
commit 98a0eef795

View File

@ -2460,7 +2460,10 @@ begin
repeat
ReadNextAtom;
if (CurPos.StartPos>SrcLen) then break;
if (CurSection=ctnInitialization) and UpAtomIs('FINALIZATION') then
if CurPos.Flag=cafEND then begin
Result:=KeyWordFuncEndPoint;
break;
end else if (CurSection=ctnInitialization) and UpAtomIs('FINALIZATION') then
begin
CurNode.EndPos:=CurPos.EndPos;
EndChildNode;
@ -2470,12 +2473,11 @@ begin
CurSection:=CurNode.Desc;
ScannedRange:=lsrFinalizationStart;
if ord(ScanTill)<=ord(ScannedRange) then exit;
end else if EndKeyWordFuncList.DoIdentifier(@Src[CurPos.StartPos]) then
begin
ReadTilBlockEnd(false,false);
end else if CurPos.Flag=cafEND then begin
Result:=KeyWordFuncEndPoint;
break;
end else if BlockStatementStartKeyWordFuncList.DoIdentifier(@Src[CurPos.StartPos])
then begin
if not ReadTilBlockEnd(false,true) then RaiseEndOfSourceExpected;
end else if UpAtomIs('WITH') then begin
ReadWithStatement(true,true);
end;
until false;
Result:=true;