diff trunk/src/cmd/ImportGraph.d @ 780:edd217e14736

Using CompilationContext in command 'igraph'.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Wed, 20 Feb 2008 23:13:56 +0100
parents 8e6fed11bb68
children 57ef69eced96
line wrap: on
line diff
--- a/trunk/src/cmd/ImportGraph.d	Wed Feb 20 22:47:33 2008 +0100
+++ b/trunk/src/cmd/ImportGraph.d	Wed Feb 20 23:13:56 2008 +0100
@@ -9,6 +9,7 @@
 import dil.semantic.Module;
 import dil.parser.ImportParser;
 import dil.SourceText;
+import dil.Compilation;
 import Settings;
 import common;
 
@@ -227,7 +228,7 @@
   }
 }
 
-void execute(string filePathString, string[] importPaths, string[] strRegexps,
+void execute(string filePathString, CompilationContext context, string[] strRegexps,
              uint levels, string siStyle, string piStyle, IGraphOption options)
 {
   // Init regular expressions.
@@ -235,15 +236,14 @@
   foreach (strRegexp; strRegexps)
     regexps ~= new RegExp(strRegexp);
 
-  // Add directory of file and global directories to import paths.
+  // Add the directory of the file to the import paths.
   auto filePath = new FilePath(filePathString);
   auto fileDir = filePath.folder();
-  importPaths ~= fileDir;
-  importPaths ~= GlobalSettings.importPaths;
+  context.importPaths ~= fileDir;
 
   auto gbuilder = new GraphBuilder;
 
-  gbuilder.importPaths = importPaths;
+  gbuilder.importPaths = context.importPaths;
   gbuilder.options = options;
   gbuilder.filterPredicate = (string moduleFQNPath) {
     foreach (rx; regexps)