Browse Source

* Fix package parsing

Michaël Van Canneyt 1 year ago
parent
commit
7fe602ebb0
1 changed files with 11 additions and 4 deletions
  1. 11 4
      packages/fcl-passrc/src/pparser.pp

+ 11 - 4
packages/fcl-passrc/src/pparser.pp

@@ -4218,15 +4218,22 @@ procedure TPasParser.ParseRequires(ASection: TPasPackageSection);
 var
   Pck : TPasRequiredPackage;
   PckPos : TPasSourcePos;
+  N : String;
 
 begin
   repeat
-    ExpectIdentifier([tkPackage]);
+    N:='';
     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);
-    NextToken;
-  until CurToken=tkSemicolon;
+  until (CurToken=tkSemicolon);
 end;
 
 // On Entry, current token is contains.