json.nim: tiny refactoring

This commit is contained in:
Araq
2019-04-01 16:24:04 +02:00
parent cce8d3da27
commit fda1352ccf

View File

@@ -1023,10 +1023,7 @@ proc toIdentNode(typeNode: NimNode): NimNode =
proc createGetEnumCall(jsonNode, kindType: NimNode): NimNode =
# -> getEnum(`jsonNode`, `kindType`)
let getEnumSym = bindSym("getEnum")
let astStrLit = toStrLit(jsonNode)
let getEnumCall = newCall(getEnumSym, jsonNode, astStrLit, kindType)
return getEnumCall
result = newCall(bindSym("getEnum"), jsonNode, toStrLit(jsonNode), kindType)
proc createOfBranchCond(ofBranch, getEnumCall: NimNode): NimNode =
## Creates an expression that acts as the condition for an ``of`` branch.