summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-09-24 21:00:23 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-09-24 21:00:31 +0200
commit9b810b17a20877d6229f1e9b069ec0478d234892 (patch)
tree8fd79edec8e95aa5d47b80f09e6fb3fc8b515041
parentcd27b7710ddfb8d227c4ad3326c82586fd486c5b (diff)
downloadNim-9b810b17a20877d6229f1e9b069ec0478d234892.tar.gz
fixes #4803
-rw-r--r--compiler/ast.nim3
-rw-r--r--compiler/vm.nim3
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index 131c2a38f..d8939fc60 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -1408,6 +1408,7 @@ proc copyNode*(src: PNode): PNode =
   result.info = src.info
   result.typ = src.typ
   result.flags = src.flags * PersistentNodeFlags
+  result.comment = src.comment
   when defined(useNodeIds):
     if result.id == nodeIdToDebug:
       echo "COMES FROM ", src.id
@@ -1426,6 +1427,7 @@ proc shallowCopy*(src: PNode): PNode =
   result.info = src.info
   result.typ = src.typ
   result.flags = src.flags * PersistentNodeFlags
+  result.comment = src.comment
   when defined(useNodeIds):
     if result.id == nodeIdToDebug:
       echo "COMES FROM ", src.id
@@ -1445,6 +1447,7 @@ proc copyTree*(src: PNode): PNode =
   result.info = src.info
   result.typ = src.typ
   result.flags = src.flags * PersistentNodeFlags
+  result.comment = src.comment
   when defined(useNodeIds):
     if result.id == nodeIdToDebug:
       echo "COMES FROM ", src.id
diff --git a/compiler/vm.nim b/compiler/vm.nim
index 2e2a49db5..efcc55c59 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -171,6 +171,7 @@ proc copyValue(src: PNode): PNode =
   result.info = src.info
   result.typ = src.typ
   result.flags = src.flags * PersistentNodeFlags
+  result.comment = src.comment
   when defined(useNodeIds):
     if result.id == nodeIdToDebug:
       echo "COMES FROM ", src.id
@@ -1071,7 +1072,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
     of opcRepr:
       decodeB(rkNode)
       createStr regs[ra]
-      regs[ra].node.strVal = renderTree(regs[rb].regToNode, {renderNoComments})
+      regs[ra].node.strVal = renderTree(regs[rb].regToNode, {renderNoComments, renderDocComments})
     of opcQuit:
       if c.mode in {emRepl, emStaticExpr, emStaticStmt}:
         message(c.debug[pc], hintQuitCalled)