mirror of
https://github.com/status-im/nim-stew.git
synced 2025-01-23 18:39:28 +00:00
[recordFields] discriminator fields will be indicated by non-nil caseField and nil caseBranch
This commit is contained in:
parent
cb9b6735ac
commit
3c57ca7555
@ -42,8 +42,8 @@ iterator recordFields*(typeImpl: NimNode): FieldDescription =
|
|||||||
]
|
]
|
||||||
|
|
||||||
template recuseInto(childNode: NimNode,
|
template recuseInto(childNode: NimNode,
|
||||||
currentCaseField: NimNode = nil,
|
currentCaseField: NimNode = nil,
|
||||||
currentCaseBranch: NimNode = nil) =
|
currentCaseBranch: NimNode = nil) =
|
||||||
traversalStack.add (childNode, 0, currentCaseField, currentCaseBranch)
|
traversalStack.add (childNode, 0, currentCaseField, currentCaseBranch)
|
||||||
|
|
||||||
while true:
|
while true:
|
||||||
@ -84,7 +84,7 @@ iterator recordFields*(typeImpl: NimNode): FieldDescription =
|
|||||||
else:
|
else:
|
||||||
doAssert false
|
doAssert false
|
||||||
|
|
||||||
recuseInto newTree(nnkRecCase, n[0])
|
recuseInto newTree(nnkRecCase, n[0]), n[0]
|
||||||
continue
|
continue
|
||||||
|
|
||||||
of nnkIdentDefs:
|
of nnkIdentDefs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user