From f714881ae971c89deec85a245dc5fe3ba3fba9cd Mon Sep 17 00:00:00 2001 From: flyx Date: Sun, 8 Mar 2020 19:22:34 +0100 Subject: [PATCH] Fixed submodules. Fixed some depr warnings. Fixes #77 --- .gitmodules | 2 +- yaml/dom.nim | 6 +++--- yaml/hints.nim | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9a4284a..50ce085 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/yaml/dom.nim b/yaml/dom.nim index 1a47ab6..07cad96 100644 --- a/yaml/dom.nim +++ b/yaml/dom.nim @@ -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, ");"].} diff --git a/yaml/hints.nim b/yaml/hints.nim index e4ef3f9..296e556 100644 --- a/yaml/hints.nim +++ b/yaml/hints.nim @@ -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: