summary refs log tree commit diff stats
path: root/compiler/astalgo.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-02-25 01:21:00 +0100
committerAraq <rumpf_a@web.de>2014-02-25 01:21:00 +0100
commit20131c32af45905fcbfd64ce1fbdfa8e83ecee2d (patch)
tree24f2d9c91387ce4fabf400089440521c9b1fb034 /compiler/astalgo.nim
parent10768904eb65da1899d0d48cc1a2f3547af3bef0 (diff)
parent263cabd1c27977aa32c849ffb334984e8d476b97 (diff)
downloadNim-20131c32af45905fcbfd64ce1fbdfa8e83ecee2d.tar.gz
Merge branch 'vm2_2' into devel
Diffstat (limited to 'compiler/astalgo.nim')
-rw-r--r--compiler/astalgo.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim
index 64c1b717c..cce2cc215 100644
--- a/compiler/astalgo.nim
+++ b/compiler/astalgo.nim
@@ -337,7 +337,10 @@ proc treeToYamlAux(n: PNode, marker: var TIntSet, indent: int,
         appf(result, ",$N$1\"floatVal\": $2", 
             [istr, toRope(n.floatVal.toStrMaxPrecision)])
       of nkStrLit..nkTripleStrLit: 
-        appf(result, ",$N$1\"strVal\": $2", [istr, makeYamlString(n.strVal)])
+        if n.strVal.isNil:
+          appf(result, ",$N$1\"strVal\": null", [istr])
+        else:
+          appf(result, ",$N$1\"strVal\": $2", [istr, makeYamlString(n.strVal)])
       of nkSym: 
         appf(result, ",$N$1\"sym\": $2", 
              [istr, symToYamlAux(n.sym, marker, indent + 2, maxRecDepth)])
@@ -407,7 +410,10 @@ proc debugTree(n: PNode, indent: int, maxRecDepth: int): PRope =
         appf(result, ",$N$1\"floatVal\": $2", 
             [istr, toRope(n.floatVal.toStrMaxPrecision)])
       of nkStrLit..nkTripleStrLit: 
-        appf(result, ",$N$1\"strVal\": $2", [istr, makeYamlString(n.strVal)])
+        if n.strVal.isNil:
+          appf(result, ",$N$1\"strVal\": null", [istr])
+        else:
+          appf(result, ",$N$1\"strVal\": $2", [istr, makeYamlString(n.strVal)])
       of nkSym: 
         appf(result, ",$N$1\"sym\": $2_$3", 
             [istr, toRope(n.sym.name.s), toRope(n.sym.id)])