mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
Fix documentation and toJson signature
This commit is contained in:
@@ -644,7 +644,7 @@ proc `%`*(elements: openArray[JsonNode]): JsonNode =
|
||||
newSeq(result.elems, elements.len)
|
||||
for i, p in pairs(elements): result.elems[i] = p
|
||||
|
||||
proc toJson(x: expr): expr {.compiletime.} =
|
||||
proc toJson(x: PNimrodNode): PNimrodNode {.compiletime.} =
|
||||
case x.kind
|
||||
of nnkBracket:
|
||||
result = newNimNode(nnkBracket)
|
||||
@@ -663,7 +663,7 @@ proc toJson(x: expr): expr {.compiletime.} =
|
||||
result = prefix(result, "%")
|
||||
|
||||
macro `%*`*(x: expr): expr =
|
||||
## Convert an expression to a JsonParser directly, without having to specify
|
||||
## Convert an expression to a JsonNode directly, without having to specify
|
||||
## `%` for every element.
|
||||
result = toJson(x)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user