about summary refs log tree commit diff stats
path: root/src/utils/eprint.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/eprint.nim')
-rw-r--r--src/utils/eprint.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/eprint.nim b/src/utils/eprint.nim
index 23248363..128d34d9 100644
--- a/src/utils/eprint.nim
+++ b/src/utils/eprint.nim
@@ -9,3 +9,16 @@ template eprint*(s: varargs[string, `$`]) = {.cast(noSideEffect).}:
       stderr.write(' ')
     stderr.write(x)
   stderr.write('\n')
+
+template print*(s: varargs[string, `$`]) =
+  for x in s:
+    stdout.write(x)
+
+template printesc*(s: string) =
+  for r in s.runes:
+    if r.isControlChar():
+      stdout.write(('^' & $($r)[0].getControlLetter())
+                   .ansiFgColor(fgBlue).ansiStyle(styleBright).ansiReset())
+    else:
+      stdout.write($r)
+