codetools: parsing on E:Exception do: using ctnVarDefinition, bug #19601

git-svn-id: trunk@31317 -
This commit is contained in:
mattias 2011-06-21 14:21:47 +00:00
parent 8c5c123c5d
commit cf32ea0df9
2 changed files with 15 additions and 10 deletions

View File

@ -142,8 +142,8 @@ const
ctnWithVariable =110;
ctnWithStatement =111;
ctnOnBlock =112;
ctnOnIdentifier =113;// e.g. on E: Exception
ctnOnBlock =112;// childs: ctnOnIdentifier+ctnOnStatement, or ctnVarDefinition(with child ctnIdentifier)+ctnOnStatement
ctnOnIdentifier =113;// e.g. 'on Exception', Note: on E:Exception creates a ctnVarDefinition
ctnOnStatement =114;
// combined values

View File

@ -2963,21 +2963,21 @@ begin
ReadNextAtom;
if CurPos.Flag=cafColon then begin
// this is for example: on E: Exception do ;
if CreateNodes then begin
// close the variable
EndChildNode;
end;
if CreateNodes then
CurNode.Desc:=ctnVarDefinition;
ReadNextAtom;
AtomIsIdentifier(true);
if CreateNodes then begin
// ctnOnIdentifier for the type
// ctnIdentifier for the type
CreateChildNode;
CurNode.Desc:=ctnOnIdentifier;
CurNode.Desc:=ctnIdentifier;
CurNode.EndPos:=CurPos.EndPos;
end;
ReadNextAtom;
end;
if CurPos.Flag=cafPoint then begin
// this is for example: on Unit.Exception do ;
// for example: on Unit.Exception do ;
// or: on E:Unit.Exception do ;
ReadNextAtom;
AtomIsIdentifier(true);
if CreateNodes then begin
@ -2986,7 +2986,12 @@ begin
ReadNextAtom;
end;
if CreateNodes then begin
// close the type
if CurNode.Desc=ctnIdentifier then begin
// close the type
CurNode.Parent.EndPos:=CurNode.EndPos;
EndChildNode;
end;
// close ctnVarDefinition or ctnOnIdentifier
EndChildNode;
end;
// read 'do'