summary refs log tree commit diff stats
path: root/compiler/hlo.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-05-27 11:10:56 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-05-27 11:10:56 +0200
commit669a5644926290e19a3fc32fd319c056183ff2d9 (patch)
treee513fe2158b8fc41c44996dac864248151696327 /compiler/hlo.nim
parent12bd1c494cdbb9d3e87d9479098d0892c2e7a453 (diff)
downloadNim-669a5644926290e19a3fc32fd319c056183ff2d9.tar.gz
remove more global variables in the Nim compiler
Diffstat (limited to 'compiler/hlo.nim')
-rw-r--r--compiler/hlo.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/hlo.nim b/compiler/hlo.nim
index 8251e3179..bbbcb4e56 100644
--- a/compiler/hlo.nim
+++ b/compiler/hlo.nim
@@ -43,8 +43,8 @@ proc applyPatterns(c: PContext, n: PNode): PNode =
       if not isNil(x):
         assert x.kind in {nkStmtList, nkCall}
         # better be safe than sorry, so check evalTemplateCounter too:
-        inc(evalTemplateCounter)
-        if evalTemplateCounter > evalTemplateLimit:
+        inc(c.config.evalTemplateCounter)
+        if c.config.evalTemplateCounter > evalTemplateLimit:
           globalError(c.config, n.info, "template instantiation too nested")
         # deactivate this pattern:
         c.patterns[i] = nil
@@ -54,7 +54,7 @@ proc applyPatterns(c: PContext, n: PNode): PNode =
           result = flattenStmts(x)
         else:
           result = evalPattern(c, x, result)
-        dec(evalTemplateCounter)
+        dec(c.config.evalTemplateCounter)
         # activate this pattern again:
         c.patterns[i] = pattern