Don't generate anchors at comptime when dumping

* this is a prerequisite to getting dumping to work,
   but dumping is still blocked by #138
This commit is contained in:
Felix Krause 2023-08-30 21:40:20 +02:00
parent f60725fc93
commit 1597efa90a
1 changed files with 41 additions and 37 deletions

View File

@ -1616,6 +1616,8 @@ proc representChild*[O](
value: ref O,
) =
if isNil(value): ctx.put(scalarEvent("~", yTagNull))
else:
when nimvm: discard
else:
let p = cast[pointer](value)
# when c.anchorStyle == asNone, `referenced` is used as indicator that we are
@ -1654,6 +1656,8 @@ proc representChild*[O](
ctx.putImpl = origPut
ctx.put(ex)
ctx.representChild(value[])
when nimvm: discard
else:
if ctx.options.anchorStyle == asNone: ctx.refs[p] = (val.a, false)
proc representChild*[T](