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
|
|
@ -1754,7 +1754,9 @@ proc semPragmaBlock(c: PContext, n: PNode): PNode =
|
|||
proc semStaticStmt(c: PContext, n: PNode): PNode =
|
||||
#echo "semStaticStmt"
|
||||
#writeStackTrace()
|
||||
inc c.inStaticContext
|
||||
let a = semStmt(c, n.sons[0])
|
||||
dec c.inStaticContext
|
||||
n.sons[0] = a
|
||||
evalStaticStmt(c.module, c.cache, c.graph.config, a, c.p.owner)
|
||||
result = newNodeI(nkDiscardStmt, n.info, 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue