mirror of https://github.com/status-im/NimYAML.git
disable DOM API when using ARC (ref #85)
This commit is contained in:
parent
1346467b42
commit
d20707c4e4
|
@ -4,4 +4,8 @@
|
|||
# See the file "copying.txt", included in this
|
||||
# distribution, for details about the copyright.
|
||||
|
||||
import tlex, tjson, tserialization, tdom, tparser, tquickstart, tannotations
|
||||
|
||||
import tlex, tjson, tserialization, tparser, tquickstart, tannotations
|
||||
|
||||
when not defined(gcArc) or defined(gcOrc):
|
||||
import tdom
|
10
yaml.nim
10
yaml.nim
|
@ -38,8 +38,14 @@
|
|||
## * The hints API in `hints <yaml.hints.html>`_ provides a simple proc for
|
||||
## guessing the type of a scalar value.
|
||||
|
||||
import yaml / [dom, hints, parser, presenter, annotations,
|
||||
import yaml / [hints, parser, presenter, annotations,
|
||||
serialization, stream, taglib, tojson]
|
||||
|
||||
export dom, hints, parser, presenter, annotations,
|
||||
when not defined(gcArc) or defined(gcOrc):
|
||||
# YAML DOM may contain cycles and therefore will leak memory if used with
|
||||
# ARC but without ORC. In that case it won't be available.
|
||||
import yaml/dom
|
||||
export dom
|
||||
|
||||
export hints, parser, presenter, annotations,
|
||||
serialization, stream, taglib, tojson
|
||||
|
|
|
@ -23,6 +23,9 @@ import tables, streams, hashes, sets, strutils
|
|||
import data, stream, taglib, serialization, private/internal, parser,
|
||||
presenter
|
||||
|
||||
when defined(gcArc) and not defined(gcOrc):
|
||||
{.error: "NimYAML's DOM API only supports ORC because ARC can't deal with cycles".}
|
||||
|
||||
when defined(nimNoNil):
|
||||
{.experimental: "notnil".}
|
||||
type
|
||||
|
|
Loading…
Reference in New Issue