json.nim: tiny refactoring
This commit is contained in:
parent
cce8d3da27
commit
fda1352ccf
1 changed files with 1 additions and 4 deletions
|
|
@ -1023,10 +1023,7 @@ proc toIdentNode(typeNode: NimNode): NimNode =
|
||||||
|
|
||||||
proc createGetEnumCall(jsonNode, kindType: NimNode): NimNode =
|
proc createGetEnumCall(jsonNode, kindType: NimNode): NimNode =
|
||||||
# -> getEnum(`jsonNode`, `kindType`)
|
# -> getEnum(`jsonNode`, `kindType`)
|
||||||
let getEnumSym = bindSym("getEnum")
|
result = newCall(bindSym("getEnum"), jsonNode, toStrLit(jsonNode), kindType)
|
||||||
let astStrLit = toStrLit(jsonNode)
|
|
||||||
let getEnumCall = newCall(getEnumSym, jsonNode, astStrLit, kindType)
|
|
||||||
return getEnumCall
|
|
||||||
|
|
||||||
proc createOfBranchCond(ofBranch, getEnumCall: NimNode): NimNode =
|
proc createOfBranchCond(ofBranch, getEnumCall: NimNode): NimNode =
|
||||||
## Creates an expression that acts as the condition for an ``of`` branch.
|
## Creates an expression that acts as the condition for an ``of`` branch.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue