This commit is contained in:
Zahary Karadjov 2018-06-19 16:38:03 +03:00
parent e25fc325ba
commit 0f8082c935
3 changed files with 6 additions and 5 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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")