codetools: parsing class section type public in fpc 2.4.x, bug #18882

git-svn-id: trunk@29739 -
This commit is contained in:
mattias 2011-03-07 11:07:44 +00:00
parent 3d675e65b1
commit ec73978c03

View File

@ -779,9 +779,13 @@ end;
function TPascalParserTool.KeyWordFuncClassSection: boolean;
// change section in a class (public, private, protected, published)
var
OldSubSection: TCodeTreeNodeDesc;
begin
OldSubSection:=ctnNone;
if CurNode.Desc in AllClassSubSections then begin
// end sub section
OldSubSection:=CurNode.Desc;
CurNode.EndPos:=CurPos.StartPos;
EndChildNode;
end;
@ -801,6 +805,13 @@ begin
CurNode.Desc:=ctnClassPublished
else
RaiseStringExpectedButAtomFound('public');
if (OldSubSection<>ctnNone)
and (Scanner.CompilerMode=cmOBJFPC)
and (Scanner.Values.IsDefined('VER2_4')) then begin
// fpc 2.4.x did not reset sub section
CreateChildNode;
CurNode.Desc:=OldSubSection;
end;
Result:=true;
end;