diff --git a/yaml/serialization.nim b/yaml/serialization.nim index 0ecce94..fb1b8f8 100644 --- a/yaml/serialization.nim +++ b/yaml/serialization.nim @@ -480,33 +480,25 @@ proc yamlTag*(T: typedesc[tuple]): try: serializationTagLibrary.tags[uri] except KeyError: serializationTagLibrary.registerUri(uri) -proc fieldAnalyzer(t: typedesc): tuple[sections, maxlen: int] {.compileTime.} = - result = (1, 0) +proc fieldCount(t: typedesc): int {.compileTime.} = + result = 0 let tDesc = getType(getType(t)[1]) - echo "fieldAnalyzer: " & tDesc.treeRepr if tDesc.kind == nnkBracketExpr: # tuple - result.maxlen = tDesc.len - 1 + result = tDesc.len - 1 else: # object - var outerLen = 0 for child in tDesc[2].children: - inc(outerLen) + inc(result) if child.kind == nnkRecCase: - inc(result.sections) - var innerLen = 0 for bIndex in 1..