mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
json.nim: tiny refactoring
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user