summary refs log tree commit diff stats
path: root/lib/core/macros.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-02-27 16:44:43 +0100
committerAraq <rumpf_a@web.de>2015-02-27 16:44:55 +0100
commit3bfcfeb0cffa266b45f0803009787d7761881326 (patch)
tree13740cd238c5c72772baed5c6241c3dd6aa18eaa /lib/core/macros.nim
parent05233de66cbe4a1878e8d83b7bc8fb9df20d8ff1 (diff)
downloadNim-3bfcfeb0cffa266b45f0803009787d7761881326.tar.gz
don't use stdout for nimsuggest server mode
Diffstat (limited to 'lib/core/macros.nim')
-rw-r--r--lib/core/macros.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index dbfb2ceb3..4758dc0c1 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -456,10 +456,11 @@ proc lispRepr*(n: PNimrodNode): string {.compileTime, benign.} =
   of nnkSym: add(result, $n.symbol)
   of nnkNone: assert false
   else:
-    add(result, lispRepr(n[0]))
-    for j in 1..n.len-1:
-      add(result, ", ")
-      add(result, lispRepr(n[j]))
+    if n.len > 0:
+      add(result, lispRepr(n[0]))
+      for j in 1..n.len-1:
+        add(result, ", ")
+        add(result, lispRepr(n[j]))
 
   add(result, ")")