Browse Source

* store the filename of uses yy in xxx syntax.

git-svn-id: trunk@15745 -
marco 15 years ago
parent
commit
198fea10a8
2 changed files with 4 additions and 1 deletions
  1. 1 0
      packages/fcl-passrc/src/pastree.pp
  2. 3 1
      packages/fcl-passrc/src/pparser.pp

+ 1 - 0
packages/fcl-passrc/src/pastree.pp

@@ -255,6 +255,7 @@ type
     InitializationSection: TInitializationSection;
     FinalizationSection: TFinalizationSection;
     PackageName: string;
+    Filename   : String;  // the IN filename, only written when not empty.
   end;
 
   { TPasPackage }

+ 3 - 1
packages/fcl-passrc/src/pparser.pp

@@ -1552,7 +1552,7 @@ begin
   begin
     AUnitName := ExpectIdentifier;
 
-    Element := Engine.FindModule(AUnitName);
+    Element := Engine.FindModule(AUnitName); // should we resolve module here when "IN" filename is not known yet?
     if Assigned(Element) then
       Element.AddRef
     else
@@ -1566,6 +1566,8 @@ begin
       // todo: store unit's file name somewhere
       NextToken; // skip in
       ExpectToken(tkString); // skip unit's real file name
+      if (Element is TPasModule) and (TPasmodule(Element).filename<>'')  then
+        TPasModule(Element).FileName:=curtokenstring;
     end;
 
     if CurToken = tkSemicolon then