From ec73978c03c3e70459c46ea88e9b138de8478afb Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 7 Mar 2011 11:07:44 +0000 Subject: [PATCH] codetools: parsing class section type public in fpc 2.4.x, bug #18882 git-svn-id: trunk@29739 - --- components/codetools/pascalparsertool.pas | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index 76be534ffc..a120c61b2f 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -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;