Add sections (type, var, let, const, using) support for reorder pragma (#6326)

This commit is contained in:
BigEpsilon 2017-10-28 11:33:35 +02:00 • committed by Andreas Rumpf
commit e2af486434
10 changed files with 551 additions and 129 deletions

View file

@ -15,6 +15,7 @@ import
condsyms, idents, renderer, types, extccomp, math, magicsys, nversion,
nimsets, syntaxes, times, rodread, idgen, modulegraphs, reorder
type
TPassContext* = object of RootObj # the pass's context
fromCache*: bool # true if created by "openCached"
@ -211,7 +212,7 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream,
if n.kind == nkEmpty: break
sl.add n
if sfReorder in module.flags:
sl = reorder sl
sl = reorder(graph, sl, module, cache)
discard processTopLevelStmt(sl, a)
break
elif not processTopLevelStmt(n, a): break