Add ref int and ref int64

This commit is contained in:
coffeepots 2018-08-15 14:19:16 +01:00 committed by zah
parent 3bcc481c9b
commit 13a9a1f58b

View File

@ -9,8 +9,11 @@ proc `%`*(n: byte{not lit}): JsonNode =
proc `%`*(n: uint64{not lit}): JsonNode =
result = newJInt(int(n))
proc `%`*(n: ref int|ref int64): JsonNode =
result = newJInt(int(n[]))
proc `%`*(n: ref int | ref int64): JsonNode =
if n.isNil:
result = newJNull()
else:
result = newJInt(n[])
# Compiler requires forward decl when processing out of module
proc fromJson(n: JsonNode, argName: string, result: var bool)