summary refs log tree commit diff stats
path: root/compiler/modules.nim
diff options
context:
space:
mode:
authorEXetoC <exetoc@gmail.com>2014-03-06 02:46:31 +0100
committerEXetoC <exetoc@gmail.com>2014-03-06 02:46:31 +0100
commitd1bc6cf0981eddf283515c2d77bccca76abff99f (patch)
treeac28e32bd6143c7a06c44dbea632f28f65ea3d20 /compiler/modules.nim
parent853bdbf4948db7774bc3caf74f67ba1228f65016 (diff)
parent7904446c47f952a026d408f04431dbaf6d887b37 (diff)
downloadNim-d1bc6cf0981eddf283515c2d77bccca76abff99f.tar.gz
Merge branch 'devel' into alloc-overloads
Diffstat (limited to 'compiler/modules.nim')
-rw-r--r--compiler/modules.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/modules.nim b/compiler/modules.nim
index 6a1491682..fb1940741 100644
--- a/compiler/modules.nim
+++ b/compiler/modules.nim
@@ -1,7 +1,7 @@
 #
 #
 #           The Nimrod Compiler
-#        (c) Copyright 2013 Andreas Rumpf
+#        (c) Copyright 2014 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
 #    distribution, for details about the copyright.
@@ -20,7 +20,7 @@ type
   TModuleInMemory* = object
     compiledAt*: float
     crc*: TCrc32
-    deps*: seq[int32] ## XXX: slurped files are not currently tracked
+    deps*: seq[int32] ## XXX: slurped files are currently not tracked
     needsRecompile*: TNeedRecompile
     crcStatus*: TCrcStatus
 
@@ -83,7 +83,7 @@ proc resetAllModules* =
   for i in 0..gCompiledModules.high:
     if gCompiledModules[i] != nil:
       resetModule(i.int32)
-
+  resetPackageCache()
   # for m in cgenModules(): echo "CGEN MODULE FOUND"
 
 proc checkDepMem(fileIdx: int32): TNeedRecompile =
@@ -120,8 +120,9 @@ proc newModule(fileIdx: int32): PSym =
   if not isNimrodIdentifier(result.name.s):
     rawMessage(errInvalidModuleName, result.name.s)
   
-  result.owner = result       # a module belongs to itself
   result.info = newLineInfo(fileIdx, 1, 1)
+  result.owner = newSym(skPackage, getIdent(getPackageName(filename)), nil,
+                        result.info)
   result.position = fileIdx
   
   growCache gMemCacheData, fileIdx