Updated syntax tree to support variables in the espression.

This commit is contained in:
2020-07-01 22:15:25 -05:00
parent 503b16ec65
commit 3cab3f03e8
2 changed files with 27 additions and 0 deletions
+2
View File
@@ -7,6 +7,8 @@ def calculate_results(node):
if type(node) is parser.Num:
return float(node.value)
elif type(node) is parser.Variable:
return node.value
left = calculate_results(node.left)
right = calculate_results(node.right)