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; ctnWithVariable =110;
ctnWithStatement =111; ctnWithStatement =111;
ctnOnBlock =112; ctnOnBlock =112;// childs: ctnOnIdentifier+ctnOnStatement, or ctnVarDefinition(with child ctnIdentifier)+ctnOnStatement
ctnOnIdentifier =113;// e.g. on E: Exception ctnOnIdentifier =113;// e.g. 'on Exception', Note: on E:Exception creates a ctnVarDefinition
ctnOnStatement =114; ctnOnStatement =114;
// combined values // combined values

View File

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