parent
86af2f7b50
commit
e94aec20da
4 changed files with 22 additions and 10 deletions
|
|
@ -1075,12 +1075,13 @@ when defined(nimFixedForwardGeneric):
|
|||
dst = jsonNode.copy
|
||||
|
||||
proc initFromJson[T: SomeInteger](dst: var T; jsonNode: JsonNode, jsonPath: var string) =
|
||||
when T is uint|uint64:
|
||||
when T is uint|uint64 or (not defined(js) and int.sizeof == 4):
|
||||
verifyJsonKind(jsonNode, {JInt, JString}, jsonPath)
|
||||
case jsonNode.kind
|
||||
of JString:
|
||||
dst = T(parseBiggestUInt(jsonNode.str))
|
||||
let x = parseBiggestUInt(jsonNode.str)
|
||||
dst = cast[T](x)
|
||||
else:
|
||||
verifyJsonKind(jsonNode, {JInt}, jsonPath)
|
||||
dst = T(jsonNode.num)
|
||||
else:
|
||||
verifyJsonKind(jsonNode, {JInt}, jsonPath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue