From 7ce4433843718713f08c4231f1af53afafaa102a Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 23 Jan 2025 22:18:28 +0800 Subject: [PATCH] progress --- compiler/semexprs.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index a191453f27a8..75c914731f53 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -2447,9 +2447,9 @@ proc semQuoteAst(c: PContext, n: PNode): PNode = dummyTemplate[paramsPos].add newTreeI(nkIdentDefs, n.info, ids[i], newNodeIT(nkType, n.info, typ), c.graph.emptyNode) else: dummyTemplate[paramsPos].add newTreeI(nkIdentDefs, n.info, ids[i], getSysSym(c.graph, n.info, "typed").newSymNode, c.graph.emptyNode) - # don't allow templates to capture variables in macors without backticks + # don't allow templates to capture syms without backticks let oldScope = c.currentScope - c.currentScope = c.topLevelScope + c.currentScope = PScope(parent: nil, symbols: initStrTable(), depthLevel: 0) var tmpl = semTemplateDef(c, dummyTemplate) c.currentScope = oldScope quotes[0] = tmpl[namePos]