works!
This commit is contained in:
parent
174cc637b1
commit
5ae9aca08c
7
main.nim
7
main.nim
@ -20,7 +20,7 @@ proc do_loop[T](node: T,level : int, searchString : string = "", path: string =
|
|||||||
stdout.write("\n")
|
stdout.write("\n")
|
||||||
echo "childs: "
|
echo "childs: "
|
||||||
for y in node.keys:
|
for y in node.keys:
|
||||||
stdout.write y," [", node[y].kind,"] \n"
|
stdout.write path & "-" & y," [", node[y].kind,"] \n"
|
||||||
do_another_loop(node,level+1,searchString,path & "-" & key)
|
do_another_loop(node,level+1,searchString,path & "-" & key)
|
||||||
#children of currentObj
|
#children of currentObj
|
||||||
|
|
||||||
@ -31,11 +31,12 @@ proc do_array_loop(node : JsonNode, level : int, searchString : string = "", pat
|
|||||||
echo "Array Length", node.len()
|
echo "Array Length", node.len()
|
||||||
echo "WWWWWWWWWWWWWWW"
|
echo "WWWWWWWWWWWWWWW"
|
||||||
for b in node:
|
for b in node:
|
||||||
echo "node , b: ", b, "array_node_len: ", b.len()," ,subkind: " ,b.kind, "mainkind: ", node.kind
|
echo "\nnode , b: ", b, "array_node_len: ", b.len()," ,subkind: " ,b.kind, "mainkind: ", node.kind
|
||||||
do_another_loop(b,level+1,searchString,path & "-" & key)
|
do_another_loop(b,level+1,searchString,path & "-" & key)
|
||||||
#if node[a].kind == JString:
|
#if node[a].kind == JString:
|
||||||
#echo "String: ", node[a]
|
#echo "String: ", node[a]
|
||||||
#stdout.write "\n"
|
#stdout.write "\n"
|
||||||
|
|
||||||
|
|
||||||
proc do_another_loop[T]( node : T , level : int, searchString : string = "",path :string = "H") =
|
proc do_another_loop[T]( node : T , level : int, searchString : string = "",path :string = "H") =
|
||||||
if node.len() > 0:
|
if node.len() > 0:
|
||||||
@ -45,6 +46,8 @@ proc do_another_loop[T]( node : T , level : int, searchString : string = "",path
|
|||||||
do_loop(node[a],level,searchString,path, a)
|
do_loop(node[a],level,searchString,path, a)
|
||||||
elif node[a].kind == JArray:
|
elif node[a].kind == JArray:
|
||||||
do_array_loop(node[a],level,searchString,path,a)
|
do_array_loop(node[a],level,searchString,path,a)
|
||||||
|
elif node[a].kind == JString:
|
||||||
|
echo "String: ",path & "-" & $node[a]
|
||||||
elif node.kind == JArray:
|
elif node.kind == JArray:
|
||||||
do_array_loop(node,level,searchString,path)
|
do_array_loop(node,level,searchString,path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user