about summary refs log tree commit diff stats
path: root/src/utils
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-11-27 00:30:53 +0100
committerbptato <nincsnevem662@gmail.com>2022-11-27 00:31:56 +0100
commite7f157c792f53cb084e8694ee608f00727432a3d (patch)
treef4b640619327b5e15578cc156028102955437e36 /src/utils
parenta58d2eff7f68bf98ee3b1ba1b59de6d80743f97e (diff)
downloadchawan-e7f157c792f53cb084e8694ee608f00727432a3d.tar.gz
Also, implement proper async
Well, not really proper, but better than nothing? Maybe not.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/eprint.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/utils/eprint.nim b/src/utils/eprint.nim
index c5936d2a..6692ccf5 100644
--- a/src/utils/eprint.nim
+++ b/src/utils/eprint.nim
@@ -2,8 +2,8 @@
 
 template eprint*(s: varargs[string, `$`]) = {.cast(noSideEffect), cast(tags: []), cast(raises: []).}:
   var a = false
+  var o = ""
   when nimVm:
-    var o = ""
     for x in s:
       if not a:
         a = true
@@ -16,6 +16,7 @@ template eprint*(s: varargs[string, `$`]) = {.cast(noSideEffect), cast(tags: [])
       if not a:
         a = true
       else:
-        stderr.write(' ')
-      stderr.write(x)
-    stderr.write('\n')
+        o &= ' '
+      o &= x
+    o &= '\n'
+    stderr.write(o)