summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorhlaaf <hlaaftana@users.noreply.github.com>2018-06-06 00:36:56 +0300
committerGitHub <noreply@github.com>2018-06-06 00:36:56 +0300
commita0cb1a80dd61428de8046cee25e664b41156e6ab (patch)
treebcbfa620451c08999c606b98321f83c72d90d483 /lib/pure
parent3cbc07ac7877b03c605498760fe198e3200cc197 (diff)
downloadNim-a0cb1a80dd61428de8046cee25e664b41156e6ab.tar.gz
Allow `%` overloading in `%*` macro in json (again)
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/json.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pure/json.nim b/lib/pure/json.nim
index e7ad5bd5a..1bd53edb7 100644
--- a/lib/pure/json.nim
+++ b/lib/pure/json.nim
@@ -328,14 +328,14 @@ proc toJson(x: NimNode): NimNode {.compiletime.} =
     result = newNimNode(nnkBracket)
     for i in 0 ..< x.len:
       result.add(toJson(x[i]))
-    result = newCall(bindSym"%", result)
+    result = newCall(bindSym("%", brOpen), result)
   of nnkTableConstr: # object
     if x.len == 0: return newCall(bindSym"newJObject")
     result = newNimNode(nnkTableConstr)
     for i in 0 ..< x.len:
       x[i].expectKind nnkExprColonExpr
       result.add newTree(nnkExprColonExpr, x[i][0], toJson(x[i][1]))
-    result = newCall(bindSym"%", result)
+    result = newCall(bindSym("%", brOpen), result)
   of nnkCurly: # empty object
     x.expectLen(0)
     result = newCall(bindSym"newJObject")
@@ -343,9 +343,9 @@ proc toJson(x: NimNode): NimNode {.compiletime.} =
     result = newCall(bindSym"newJNull")
   of nnkPar:
     if x.len == 1: result = toJson(x[0])
-    else: result = newCall(bindSym"%", x)
+    else: result = newCall(bindSym("%", brOpen), x)
   else:
-    result = newCall(bindSym"%", x)
+    result = newCall(bindSym("%", brOpen), x)
 
 macro `%*`*(x: untyped): untyped =
   ## Convert an expression to a JsonNode directly, without having to specify