From d6c30617d54707e1254f057fe4b4d59421ac02c9 Mon Sep 17 00:00:00 2001
From: Kia <kia@special-circumstanc.es>
Date: Sat, 30 May 2020 16:25:28 -0600
Subject: [PATCH] tree printing works!

---
 python_arborist.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/python_arborist.py b/python_arborist.py
index ead9916..4b2080d 100644
--- a/python_arborist.py
+++ b/python_arborist.py
@@ -367,6 +367,16 @@ class TreeNode:
         return str(self.language_element) + str(self.subnodes)
 
 
+def walk_the_tree(tree, level = 0):
+    if tree == None:
+        return
+
+    print("    " * level + hex(tree.language_element))
+    for subnode in tree.subnodes:
+        walk_the_tree(subnode, level + 1)
+
 
 the_tree = deserializer(serialized_tree_final)
-print(the_tree)
\ No newline at end of file
+print(the_tree)
+
+walk_the_tree(the_tree)
\ No newline at end of file
-- 
GitLab