summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-22 15:37:57 +0200
committerAraq <rumpf_a@web.de>2018-08-22 15:37:57 +0200
commit27f488e5d9ad0e40b23fba7ab1a8b713c823e92c (patch)
tree72648ee40db80f7fc26301b6bec9dd6eb2620c1f /lib
parentdbd21d670c754501e1c14c758e09c9fce3ad01d5 (diff)
downloadNim-27f488e5d9ad0e40b23fba7ab1a8b713c823e92c.tar.gz
make more tests green; system.repr does not produce 'nil' for strings and seqs anymore
Diffstat (limited to 'lib')
-rw-r--r--lib/system/repr.nim9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/system/repr.nim b/lib/system/repr.nim
index 3dc220b87..85701c28f 100644
--- a/lib/system/repr.nim
+++ b/lib/system/repr.nim
@@ -29,7 +29,9 @@ proc reprStrAux(result: var string, s: cstring; len: int) =
   if cast[pointer](s) == nil:
     add result, "nil"
     return
-  add result, reprPointer(cast[pointer](s)) & "\""
+  if len > 0:
+    add result, reprPointer(cast[pointer](s))
+  add result, "\""
   for i in 0 .. pred(len):
     let c = s[i]
     case c
@@ -162,9 +164,10 @@ when not defined(useNimRtl):
   proc reprSequence(result: var string, p: pointer, typ: PNimType,
                     cl: var ReprClosure) =
     if p == nil:
-      add result, "nil"
+      add result, "[]"
       return
-    result.add(reprPointer(p) & "[")
+    result.add(reprPointer(p))
+    result.add '['
     var bs = typ.base.size
     for i in 0..cast[PGenericSeq](p).len-1:
       if i > 0: add result, ", "
2012-02-17 02:16:33 +0100 bugfix: optimization of complex constant string concatenations' href='/ahoang/Nim/commit/tools/cmerge.nim?h=devel&id=97366d44195a96075960749a0ea84ded582dce87'>97366d441 ^
f71eaf66b ^
0ea4b71ee ^
f71eaf66b ^
0ea4b71ee ^

a68f17a9f ^
0ea4b71ee ^
38bdf1cd7 ^
97366d441 ^
38bdf1cd7 ^
97366d441 ^
0ea4b71ee ^



7e0da3e8f ^
00a4e19e8 ^
0ea4b71ee ^
7e0da3e8f ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40