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
|
|
@ -1780,6 +1780,7 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
|||
let oldInGenericContext = c.inGenericContext
|
||||
let oldInUnrolledContext = c.inUnrolledContext
|
||||
let oldInGenericInst = c.inGenericInst
|
||||
let oldInStaticContext = c.inStaticContext
|
||||
let oldProcCon = c.p
|
||||
c.generics = @[]
|
||||
var err: string
|
||||
|
|
@ -1794,6 +1795,7 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
|||
c.inGenericContext = oldInGenericContext
|
||||
c.inUnrolledContext = oldInUnrolledContext
|
||||
c.inGenericInst = oldInGenericInst
|
||||
c.inStaticContext = oldInStaticContext
|
||||
c.p = oldProcCon
|
||||
msgs.setInfoContextLen(oldContextLen)
|
||||
setLen(c.graph.owners, oldOwnerLen)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue