From 40c386d6bc6652eac19501b920055aee37dc077a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Wed, 22 May 2024 20:32:41 +0200 Subject: [PATCH] * PAckage name can contain package keyword --- packages/fcl-passrc/src/pparser.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/fcl-passrc/src/pparser.pp b/packages/fcl-passrc/src/pparser.pp index 0b938feec5..a59b040481 100644 --- a/packages/fcl-passrc/src/pparser.pp +++ b/packages/fcl-passrc/src/pparser.pp @@ -3612,7 +3612,7 @@ begin NextToken; while CurToken = tkDot do begin - ExpectIdentifier; + ExpectIdentifier([tkPackage]); N := N + '.' + CurTokenString; NextToken; end; @@ -4158,7 +4158,7 @@ begin {$IFDEF VerbosePasParserWriteln} writeln('TPasParser.AddUseUnit AUnitName=',AUnitName,' CurModule.Name=',CurModule.Name); {$ENDIF VerbosePasParserWriteln} - if CompareText(AUnitName,CurModule.Name)=0 then + if (CompareText(AUnitName,CurModule.Name)=0) and not CurModule.InheritsFrom(TPasDynamicPackage) then begin if CompareText(AUnitName,'System')=0 then exit; // for compatibility ignore implicit use of system in system @@ -4221,7 +4221,7 @@ var begin repeat - ExpectIdentifier(); + ExpectIdentifier([tkPackage]); PckPos:=CurSourcePos; Pck:=TPasRequiredPackage(Engine.CreateElement(TPasRequiredPackage,CurtokenString,aSection,visPublic,PckPos)); aSection.Requires.Add(Pck);