mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 02:29:12 +02:00
* Fix package parsing
This commit is contained in:
parent
b313a66a47
commit
7fe602ebb0
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user