mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 23:03:48 +02:00
codetools: parsing class section type public in fpc 2.4.x, bug #18882
git-svn-id: trunk@29739 -
This commit is contained in:
parent
3d675e65b1
commit
ec73978c03
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user