summary refs log tree commit diff stats
path: root/lib/std/with.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/with.nim')
-rw-r--r--lib/std/with.nim9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/std/with.nim b/lib/std/with.nim
index 1dfb67c2e..c1ac96fcb 100644
--- a/lib/std/with.nim
+++ b/lib/std/with.nim
@@ -35,14 +35,7 @@ macro with*(arg: typed; calls: varargs[untyped]): untyped =
     doAssert a == 43
 
   result = newNimNode(nnkStmtList, arg)
-  expectKind calls, nnkArgList
-  let body =
-    if calls.len == 1 and calls[0].kind in {nnkStmtList, nnkStmtListExpr}:
-      calls[0]
-    else:
-      calls
-  for call in body:
-    result.add underscoredCall(call, arg)
+  underscoredCalls(result, calls, arg)
 
 when isMainModule:
   type