fix #8
This commit is contained in:
parent
e25fc325ba
commit
0f8082c935
|
@ -44,7 +44,7 @@ macro logScopeIMPL(prevScopes: typed,
|
|||
for k, v in assignments(bestScope.scopeAssignments):
|
||||
finalBindings[k] = v
|
||||
|
||||
for k, v in assignments(newBindings, false):
|
||||
for k, v in assignments(newBindings):
|
||||
finalBindings[k] = v
|
||||
|
||||
for k, v in finalBindings:
|
||||
|
|
|
@ -9,7 +9,7 @@ proc id*(key: string, public = false): NimNode =
|
|||
result = newIdentNode(key)
|
||||
if public: result = postfix(result, "*")
|
||||
|
||||
iterator assignments*(n: NimNode, liftIdentifiers = true): (string, NimNode) =
|
||||
iterator assignments*(n: NimNode): (string, NimNode) =
|
||||
# extract the assignment pairs from a block with assigments
|
||||
# or a call-site with keyword arguments.
|
||||
for child in n:
|
||||
|
@ -18,7 +18,7 @@ iterator assignments*(n: NimNode, liftIdentifiers = true): (string, NimNode) =
|
|||
let value = child[1]
|
||||
yield (name, value)
|
||||
|
||||
elif child.kind == nnkIdent and liftIdentifiers:
|
||||
elif child.kind == nnkIdent:
|
||||
yield ($child, child)
|
||||
|
||||
else:
|
||||
|
|
|
@ -11,8 +11,9 @@ logScope:
|
|||
logScope:
|
||||
c = 100
|
||||
|
||||
proc main =
|
||||
proc main(arg: int) =
|
||||
logScope:
|
||||
arg
|
||||
c = 10
|
||||
|
||||
logScope:
|
||||
|
@ -20,7 +21,7 @@ proc main =
|
|||
|
||||
info("main started", a = 10, b = "inner-b", d = "some-d")
|
||||
|
||||
main()
|
||||
main(50)
|
||||
|
||||
info("exiting", msg = "bye bye")
|
||||
|
||||
|
|
Loading…
Reference in New Issue