mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-21 11:20:44 +01:00
codetools: parsing on E:Exception do: using ctnVarDefinition, bug #19601
git-svn-id: trunk@31317 -
This commit is contained in:
parent
8c5c123c5d
commit
cf32ea0df9
@ -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
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user