* Fix package parsing

This commit is contained in:
Michaël Van Canneyt 2024-05-24 09:19:17 +02:00
parent b313a66a47
commit 7fe602ebb0

View File

@ -4218,15 +4218,22 @@ procedure TPasParser.ParseRequires(ASection: TPasPackageSection);
var var
Pck : TPasRequiredPackage; Pck : TPasRequiredPackage;
PckPos : TPasSourcePos; PckPos : TPasSourcePos;
N : String;
begin begin
repeat repeat
ExpectIdentifier([tkPackage]); N:='';
PckPos:=CurSourcePos; PckPos:=CurSourcePos;
Pck:=TPasRequiredPackage(Engine.CreateElement(TPasRequiredPackage,CurtokenString,aSection,visPublic,PckPos)); Repeat
ExpectIdentifier([tkPackage]);
if N<>'' then
N:=N+'.';
N:=N+CurtokenString;
NextToken;
until (CurToken in [tkSemicolon,tkComma]);
Pck:=TPasRequiredPackage(Engine.CreateElement(TPasRequiredPackage,N,aSection,visPublic,PckPos));
aSection.Requires.Add(Pck); aSection.Requires.Add(Pck);
NextToken; until (CurToken=tkSemicolon);
until CurToken=tkSemicolon;
end; end;
// On Entry, current token is contains. // On Entry, current token is contains.