asdf
This commit is contained in:
parent
93bdbf42c9
commit
174cc637b1
11
main.nim
11
main.nim
@ -20,18 +20,19 @@ proc do_loop[T](node: T,level : int, searchString : string = "", path: string =
|
||||
stdout.write("\n")
|
||||
echo "childs: "
|
||||
for y in node.keys:
|
||||
stdout.write ", " ,y," [", node[y].kind,"] \n"
|
||||
stdout.write y," [", node[y].kind,"] \n"
|
||||
do_another_loop(node,level+1,searchString,path & "-" & key)
|
||||
#children of currentObj
|
||||
|
||||
proc do_array_loop(node : JsonNode, level : int, searchString : string = "", path: string = "") =
|
||||
proc do_array_loop(node : JsonNode, level : int, searchString : string = "", path: string = "",key :string = "") =
|
||||
if searchString == "" or node.contains(searchString):
|
||||
echo "Key: ",key
|
||||
echo "Array Elements: ", node.getElems()
|
||||
echo "Array Length", node.len()
|
||||
echo "WWWWWWWWWWWWWWW"
|
||||
for b in node:
|
||||
echo "array_node_len: ", b.len()," ,subkind: " ,b.kind, "mainkind: ", node.kind
|
||||
do_another_loop(b,level+1,searchString,path & "-" & $node)
|
||||
echo "node , b: ", b, "array_node_len: ", b.len()," ,subkind: " ,b.kind, "mainkind: ", node.kind
|
||||
do_another_loop(b,level+1,searchString,path & "-" & key)
|
||||
#if node[a].kind == JString:
|
||||
#echo "String: ", node[a]
|
||||
#stdout.write "\n"
|
||||
@ -43,7 +44,7 @@ proc do_another_loop[T]( node : T , level : int, searchString : string = "",path
|
||||
if node[a].kind == JObject:
|
||||
do_loop(node[a],level,searchString,path, a)
|
||||
elif node[a].kind == JArray:
|
||||
do_array_loop(node[a],level,searchString,path)
|
||||
do_array_loop(node[a],level,searchString,path,a)
|
||||
elif node.kind == JArray:
|
||||
do_array_loop(node,level,searchString,path)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user