A motivating example for the new bindSym behavior.
The example is a proof-of-concept logging library, allowing you to define lexically-scoped environments where certain logging attributes are applied automatically to all logging statements. fixes tmacro1 (use of `bindSym` inside static blocks)
This commit is contained in:
parent
bdcb729597
commit
2b8bf8fc4a
5 changed files with 160 additions and 1 deletions
|
|
@ -199,7 +199,7 @@ proc semBindSym(c: PContext, n: PNode): PNode =
|
|||
if s != nil:
|
||||
# we need to mark all symbols:
|
||||
var sc = symChoice(c, id, s, TSymChoiceRule(isMixin.intVal))
|
||||
if not getCurrOwner(c).isCompileTimeProc:
|
||||
if not (c.inStaticContext > 0 or getCurrOwner(c).isCompileTimeProc):
|
||||
# inside regular code, bindSym resolves to the sym-choice
|
||||
# nodes (see tinspectsymbol)
|
||||
return sc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue