Updated exceptions to be more fitting, fixed a parse bug in the tokenizer and added the start of the calc engine.

This commit is contained in:
2020-04-08 00:08:20 -05:00
parent c760dc04b5
commit 528098d913
3 changed files with 28 additions and 17 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import token
import tokenizer
#userInput = input('Enter your formula: ')
tokens = tokenizer.get_tokens_from_expression_string("1 + 2 / 3 (3 * 4) 5")
tokens = tokenizer.get_tokens_from_expression_string("i + 2 / i (3 * n) 5")
for t in tokens:
print("%s (%s) " %(t.value, token.TokenType.get_operator_name(t.type)), end = "")