refactoring: fewer global variables

This commit is contained in:
Andreas Rumpf 2018-05-27 19:19:12 +02:00
commit a325692fb2
6 changed files with 36 additions and 43 deletions

View file

@ -10,4 +10,15 @@
## Include file that imports all plugins that are active.
import
locals / locals, itersgen
compiler / [pluginsupport, idents, ast], locals, itersgen
const
plugins: array[2, Plugin] = [
("stdlib", "system", "iterToProc", iterToProcImpl),
("stdlib", "system", "locals", semLocals)
]
proc getPlugin*(ic: IdentCache; fn: PSym): Transformation =
for p in plugins:
if pluginMatches(ic, p, fn): return p.t
return nil