Updated the tokenizer to use a deque object instead of a list. The old calc_engine should still work, not tested. New parser code works with this change.

This commit is contained in:
2020-07-01 19:28:09 -05:00
parent 212f3bfaf4
commit fcd0076891
3 changed files with 10 additions and 24 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ debug = False
def calculate_results(tokens):
# Main entry into the calc_engine.
# Returns the result of arthmetic as described by the token list.
return process_tokens(convert_to_deque(tokens), True)
return process_tokens(tokens, True)
def process_tokens(tokens, top_level = False):
pending_operations = []