WIP: disallow 'nil' for strings and seqs
This commit is contained in:
parent
32afc1a562
commit
dae5450947
43 changed files with 207 additions and 173 deletions
|
|
@ -293,9 +293,9 @@ proc renderRstToJsonNode(node: PRstNode): JsonNode =
|
|||
(key: "kind", val: %($node.kind)),
|
||||
(key: "level", val: %BiggestInt(node.level))
|
||||
]
|
||||
if node.text != nil:
|
||||
if node.text.len > 0:
|
||||
result.add("text", %node.text)
|
||||
if node.sons != nil and len(node.sons) > 0:
|
||||
if len(node.sons) > 0:
|
||||
var accm = newSeq[JsonNode](len(node.sons))
|
||||
for i, son in node.sons:
|
||||
accm[i] = renderRstToJsonNode(son)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue