mirror of https://github.com/status-im/NimYAML.git
Fixed submodules. Fixed some depr warnings. Fixes #77
This commit is contained in:
parent
f8b264f992
commit
f714881ae9
|
@ -1,4 +1,4 @@
|
|||
[submodule "test/yaml-test-suite"]
|
||||
path = test/yaml-test-suite
|
||||
url = https://github.com/yaml/yaml-test-suite.git
|
||||
branch = data
|
||||
branch = data-2020-02-11
|
||||
|
|
|
@ -94,7 +94,7 @@ proc eqImpl(x, y: YamlNode, alreadyVisited: var HashSet[pointer]): bool =
|
|||
compare(xValue, matchingValue)
|
||||
|
||||
proc `==`*(x, y: YamlNode): bool =
|
||||
var alreadyVisited = initSet[pointer]()
|
||||
var alreadyVisited = initHashSet[pointer]()
|
||||
result = eqImpl(x, y, alreadyVisited)
|
||||
|
||||
proc `$`*(n: YamlNode): string =
|
||||
|
@ -134,7 +134,7 @@ proc initYamlDoc*(root: YamlNode): YamlDocument = result.root = root
|
|||
proc composeNode(s: var YamlStream, tagLib: TagLibrary,
|
||||
c: ConstructionContext):
|
||||
YamlNode {.raises: [YamlStreamError, YamlConstructionError].} =
|
||||
template addAnchor(c: ConstructionContext, target: AnchorId): typed =
|
||||
template addAnchor(c: ConstructionContext, target: AnchorId) =
|
||||
if target != yAnchorNone:
|
||||
when defined(JS):
|
||||
{.emit: [c, """.refs.set(""", target, ", ", result, ");"].}
|
||||
|
@ -269,7 +269,7 @@ proc serializeNode(n: YamlNode, c: SerializationContext, a: AnchorStyle,
|
|||
serializeNode(value, c, a, tagLib)
|
||||
c.put(endMapEvent())
|
||||
|
||||
template processAnchoredEvent(target: untyped, c: SerializationContext): typed =
|
||||
template processAnchoredEvent(target: untyped, c: SerializationContext) =
|
||||
var anchorId: AnchorId
|
||||
when defined(JS):
|
||||
{.emit: [anchorId, " = ", c, ".refs.get(", target, ");"].}
|
||||
|
|
|
@ -71,7 +71,7 @@ type
|
|||
ythAfterTimeSpace, ythAfterTimeZ, ythAfterTimePlusMinus, ythTzHour1,
|
||||
ythTzHour2, ythTzHourColon, ythTzMinute1, ythTzMinute2
|
||||
|
||||
macro typeHintStateMachine(c: untyped, content: varargs[untyped]): typed =
|
||||
macro typeHintStateMachine(c: untyped, content: varargs[untyped]) =
|
||||
yAssert content.kind == nnkArgList
|
||||
result = newNimNode(nnkCaseStmt, content).add(copyNimNode(c))
|
||||
for branch in content.children:
|
||||
|
@ -86,7 +86,7 @@ macro typeHintStateMachine(c: untyped, content: varargs[untyped]): typed =
|
|||
inc(i)
|
||||
for rule in branch[i].children:
|
||||
yAssert rule.kind == nnkInfix
|
||||
yAssert $rule[0].ident == "=>"
|
||||
yAssert rule[0].strVal == "=>"
|
||||
var stateBranch = newNimNode(nnkOfBranch, rule)
|
||||
case rule[1].kind
|
||||
of nnkBracket:
|
||||
|
|
Loading…
Reference in New Issue