Fixed a bug in the tokenizer to make sure it reverses the list before returning. Fixed up the calc engine, however addition/subtraction bugs still exist.

This commit is contained in:
2020-04-08 15:05:34 -05:00
parent c42c8471c0
commit ee9ba528c6
3 changed files with 37 additions and 19 deletions
+5 -1
View File
@@ -69,6 +69,10 @@ def get_tokens_from_expression_string(expression_string):
tokens.append(token.CToken(c + str(symbols_dic[c]), token.TokenType.variable))
parsing_number = False
tmp = ""
#When building this list we've effectively ordered the tokens in reverse order from how we want to
#process them. So, reverse the order of the list before returning them to the caller, we don't want
#the caller to have to worry about such a minor detail.
tokens.reverse()
return tokens