disallow recursive module dependencies
This commit is contained in:
parent
204838b358
commit
074f276c8a
14 changed files with 47 additions and 45 deletions
|
|
@ -36,6 +36,8 @@ type
|
|||
invalidTransitiveClosure: bool
|
||||
inclToMod*: Table[int32, int32] # mapping of include file to the
|
||||
# first module that included it
|
||||
importStack*: seq[int32] # The current import stack. Used for detecting recursive
|
||||
# module dependencies.
|
||||
|
||||
{.this: g.}
|
||||
|
||||
|
|
@ -44,12 +46,14 @@ proc newModuleGraph*(): ModuleGraph =
|
|||
initStrTable(result.packageSyms)
|
||||
result.deps = initIntSet()
|
||||
result.modules = @[]
|
||||
result.importStack = @[]
|
||||
result.inclToMod = initTable[int32, int32]()
|
||||
|
||||
proc resetAllModules*(g: ModuleGraph) =
|
||||
initStrTable(packageSyms)
|
||||
deps = initIntSet()
|
||||
modules = @[]
|
||||
importStack = @[]
|
||||
inclToMod = initTable[int32, int32]()
|
||||
|
||||
proc getModule*(g: ModuleGraph; fileIdx: int32): PSym =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue