From a5169230a391345e63e3b6101d9f52559e7fa892 Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Thu, 25 Feb 2016 22:52:52 +0100 Subject: [PATCH] Fixed JSON module to compile against new Nim API --- private/json.nim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/private/json.nim b/private/json.nim index 609360a..7f1c4f4 100644 --- a/private/json.nim +++ b/private/json.nim @@ -126,7 +126,7 @@ proc constructJson*(s: var YamlStream): seq[JsonNode] = let jsonScalar = jsonFromScalar(event.scalarContent, event.scalarTag) levels[levels.high].node.fields.add( - (key: levels[levels.high].key, val: jsonScalar)) + levels[levels.high].key, jsonScalar) levels[levels.high].key = nil if event.scalarAnchor != yAnchorNone: anchors[event.scalarAnchor] = jsonScalar @@ -145,7 +145,7 @@ proc constructJson*(s: var YamlStream): seq[JsonNode] = "non-scalar as key not allowed in JSON") else: levels[levels.high].node.fields.add( - (key: levels[levels.high].key, val: level.node)) + levels[levels.high].key, level.node) levels[levels.high].key = nil else: discard # will never happen @@ -170,8 +170,8 @@ proc constructJson*(s: var YamlStream): seq[JsonNode] = else: try: levels[levels.high].node.fields.add( - (key: levels[levels.high].key, - val: anchors[event.aliasTarget])) + levels[levels.high].key, + anchors[event.aliasTarget]) except KeyError: # we can safely assume that this doesn't happen. It would # have resulted in a parser error earlier. @@ -204,4 +204,4 @@ proc loadToJson*(s: Stream): seq[JsonNode] = except AssertionError: raise except Exception: # compiler bug: https://github.com/nim-lang/Nim/issues/3772 - assert(false) \ No newline at end of file + assert(false)