Updated the tokenizer to include a method to replace variable tokens with the values provided in a list.

This commit is contained in:
2020-04-13 09:10:14 -05:00
parent 7605bcdf68
commit c75905d13c
3 changed files with 25 additions and 14 deletions
+5 -2
View File
@@ -1,7 +1,10 @@
import token
import copy
def calculate_results(tokens):
return handle_add_and_subtract(tokens)
def calculate_results(tokens):
new_list = copy.deepcopy(tokens)
new_list.reverse()
return handle_add_and_subtract(new_list)
def handle_parenthesis(tokens, call_has_priority = False):
running_value = 0