summary refs log tree commit diff stats
path: root/compiler/astalgo.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-02-22 01:09:43 +0100
committerAraq <rumpf_a@web.de>2014-02-22 01:09:43 +0100
commitee74706c3b1e040dded3baf2ee3c05ae111c968a (patch)
tree1997239cf771c759dd8d8a5feb3fbc2e614e8c15 /compiler/astalgo.nim
parent6e584c42c2d340a31acad85add79b579b3e56f0b (diff)
downloadNim-ee74706c3b1e040dded3baf2ee3c05ae111c968a.tar.gz
fixed opcConv
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)])