* PAckage name can contain package keyword

This commit is contained in:
Michaël Van Canneyt 2024-05-22 20:32:41 +02:00
parent b245f2deb1
commit 40c386d6bc

View File

@ -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);